ltmain.sh 154 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576777879808182838485868788899091929394959697989910010110210310410510610710810911011111211311411511611711811912012112212312412512612712812913013113213313413513613713813914014114214314414514614714814915015115215315415515615715815916016116216316416516616716816917017117217317417517617717817918018118218318418518618718818919019119219319419519619719819920020120220320420520620720820921021121221321421521621721821922022122222322422522622722822923023123223323423523623723823924024124224324424524624724824925025125225325425525625725825926026126226326426526626726826927027127227327427527627727827928028128228328428528628728828929029129229329429529629729829930030130230330430530630730830931031131231331431531631731831932032132232332432532632732832933033133233333433533633733833934034134234334434534634734834935035135235335435535635735835936036136236336436536636736836937037137237337437537637737837938038138238338438538638738838939039139239339439539639739839940040140240340440540640740840941041141241341441541641741841942042142242342442542642742842943043143243343443543643743843944044144244344444544644744844945045145245345445545645745845946046146246346446546646746846947047147247347447547647747847948048148248348448548648748848949049149249349449549649749849950050150250350450550650750850951051151251351451551651751851952052152252352452552652752852953053153253353453553653753853954054154254354454554654754854955055155255355455555655755855956056156256356456556656756856957057157257357457557657757857958058158258358458558658758858959059159259359459559659759859960060160260360460560660760860961061161261361461561661761861962062162262362462562662762862963063163263363463563663763863964064164264364464564664764864965065165265365465565665765865966066166266366466566666766866967067167267367467567667767867968068168268368468568668768868969069169269369469569669769869970070170270370470570670770870971071171271371471571671771871972072172272372472572672772872973073173273373473573673773873974074174274374474574674774874975075175275375475575675775875976076176276376476576676776876977077177277377477577677777877978078178278378478578678778878979079179279379479579679779879980080180280380480580680780880981081181281381481581681781881982082182282382482582682782882983083183283383483583683783883984084184284384484584684784884985085185285385485585685785885986086186286386486586686786886987087187287387487587687787887988088188288388488588688788888989089189289389489589689789889990090190290390490590690790890991091191291391491591691791891992092192292392492592692792892993093193293393493593693793893994094194294394494594694794894995095195295395495595695795895996096196296396496596696796896997097197297397497597697797897998098198298398498598698798898999099199299399499599699799899910001001100210031004100510061007100810091010101110121013101410151016101710181019102010211022102310241025102610271028102910301031103210331034103510361037103810391040104110421043104410451046104710481049105010511052105310541055105610571058105910601061106210631064106510661067106810691070107110721073107410751076107710781079108010811082108310841085108610871088108910901091109210931094109510961097109810991100110111021103110411051106110711081109111011111112111311141115111611171118111911201121112211231124112511261127112811291130113111321133113411351136113711381139114011411142114311441145114611471148114911501151115211531154115511561157115811591160116111621163116411651166116711681169117011711172117311741175117611771178117911801181118211831184118511861187118811891190119111921193119411951196119711981199120012011202120312041205120612071208120912101211121212131214121512161217121812191220122112221223122412251226122712281229123012311232123312341235123612371238123912401241124212431244124512461247124812491250125112521253125412551256125712581259126012611262126312641265126612671268126912701271127212731274127512761277127812791280128112821283128412851286128712881289129012911292129312941295129612971298129913001301130213031304130513061307130813091310131113121313131413151316131713181319132013211322132313241325132613271328132913301331133213331334133513361337133813391340134113421343134413451346134713481349135013511352135313541355135613571358135913601361136213631364136513661367136813691370137113721373137413751376137713781379138013811382138313841385138613871388138913901391139213931394139513961397139813991400140114021403140414051406140714081409141014111412141314141415141614171418141914201421142214231424142514261427142814291430143114321433143414351436143714381439144014411442144314441445144614471448144914501451145214531454145514561457145814591460146114621463146414651466146714681469147014711472147314741475147614771478147914801481148214831484148514861487148814891490149114921493149414951496149714981499150015011502150315041505150615071508150915101511151215131514151515161517151815191520152115221523152415251526152715281529153015311532153315341535153615371538153915401541154215431544154515461547154815491550155115521553155415551556155715581559156015611562156315641565156615671568156915701571157215731574157515761577157815791580158115821583158415851586158715881589159015911592159315941595159615971598159916001601160216031604160516061607160816091610161116121613161416151616161716181619162016211622162316241625162616271628162916301631163216331634163516361637163816391640164116421643164416451646164716481649165016511652165316541655165616571658165916601661166216631664166516661667166816691670167116721673167416751676167716781679168016811682168316841685168616871688168916901691169216931694169516961697169816991700170117021703170417051706170717081709171017111712171317141715171617171718171917201721172217231724172517261727172817291730173117321733173417351736173717381739174017411742174317441745174617471748174917501751175217531754175517561757175817591760176117621763176417651766176717681769177017711772177317741775177617771778177917801781178217831784178517861787178817891790179117921793179417951796179717981799180018011802180318041805180618071808180918101811181218131814181518161817181818191820182118221823182418251826182718281829183018311832183318341835183618371838183918401841184218431844184518461847184818491850185118521853185418551856185718581859186018611862186318641865186618671868186918701871187218731874187518761877187818791880188118821883188418851886188718881889189018911892189318941895189618971898189919001901190219031904190519061907190819091910191119121913191419151916191719181919192019211922192319241925192619271928192919301931193219331934193519361937193819391940194119421943194419451946194719481949195019511952195319541955195619571958195919601961196219631964196519661967196819691970197119721973197419751976197719781979198019811982198319841985198619871988198919901991199219931994199519961997199819992000200120022003200420052006200720082009201020112012201320142015201620172018201920202021202220232024202520262027202820292030203120322033203420352036203720382039204020412042204320442045204620472048204920502051205220532054205520562057205820592060206120622063206420652066206720682069207020712072207320742075207620772078207920802081208220832084208520862087208820892090209120922093209420952096209720982099210021012102210321042105210621072108210921102111211221132114211521162117211821192120212121222123212421252126212721282129213021312132213321342135213621372138213921402141214221432144214521462147214821492150215121522153215421552156215721582159216021612162216321642165216621672168216921702171217221732174217521762177217821792180218121822183218421852186218721882189219021912192219321942195219621972198219922002201220222032204220522062207220822092210221122122213221422152216221722182219222022212222222322242225222622272228222922302231223222332234223522362237223822392240224122422243224422452246224722482249225022512252225322542255225622572258225922602261226222632264226522662267226822692270227122722273227422752276227722782279228022812282228322842285228622872288228922902291229222932294229522962297229822992300230123022303230423052306230723082309231023112312231323142315231623172318231923202321232223232324232523262327232823292330233123322333233423352336233723382339234023412342234323442345234623472348234923502351235223532354235523562357235823592360236123622363236423652366236723682369237023712372237323742375237623772378237923802381238223832384238523862387238823892390239123922393239423952396239723982399240024012402240324042405240624072408240924102411241224132414241524162417241824192420242124222423242424252426242724282429243024312432243324342435243624372438243924402441244224432444244524462447244824492450245124522453245424552456245724582459246024612462246324642465246624672468246924702471247224732474247524762477247824792480248124822483248424852486248724882489249024912492249324942495249624972498249925002501250225032504250525062507250825092510251125122513251425152516251725182519252025212522252325242525252625272528252925302531253225332534253525362537253825392540254125422543254425452546254725482549255025512552255325542555255625572558255925602561256225632564256525662567256825692570257125722573257425752576257725782579258025812582258325842585258625872588258925902591259225932594259525962597259825992600260126022603260426052606260726082609261026112612261326142615261626172618261926202621262226232624262526262627262826292630263126322633263426352636263726382639264026412642264326442645264626472648264926502651265226532654265526562657265826592660266126622663266426652666266726682669267026712672267326742675267626772678267926802681268226832684268526862687268826892690269126922693269426952696269726982699270027012702270327042705270627072708270927102711271227132714271527162717271827192720272127222723272427252726272727282729273027312732273327342735273627372738273927402741274227432744274527462747274827492750275127522753275427552756275727582759276027612762276327642765276627672768276927702771277227732774277527762777277827792780278127822783278427852786278727882789279027912792279327942795279627972798279928002801280228032804280528062807280828092810281128122813281428152816281728182819282028212822282328242825282628272828282928302831283228332834283528362837283828392840284128422843284428452846284728482849285028512852285328542855285628572858285928602861286228632864286528662867286828692870287128722873287428752876287728782879288028812882288328842885288628872888288928902891289228932894289528962897289828992900290129022903290429052906290729082909291029112912291329142915291629172918291929202921292229232924292529262927292829292930293129322933293429352936293729382939294029412942294329442945294629472948294929502951295229532954295529562957295829592960296129622963296429652966296729682969297029712972297329742975297629772978297929802981298229832984298529862987298829892990299129922993299429952996299729982999300030013002300330043005300630073008300930103011301230133014301530163017301830193020302130223023302430253026302730283029303030313032303330343035303630373038303930403041304230433044304530463047304830493050305130523053305430553056305730583059306030613062306330643065306630673068306930703071307230733074307530763077307830793080308130823083308430853086308730883089309030913092309330943095309630973098309931003101310231033104310531063107310831093110311131123113311431153116311731183119312031213122312331243125312631273128312931303131313231333134313531363137313831393140314131423143314431453146314731483149315031513152315331543155315631573158315931603161316231633164316531663167316831693170317131723173317431753176317731783179318031813182318331843185318631873188318931903191319231933194319531963197319831993200320132023203320432053206320732083209321032113212321332143215321632173218321932203221322232233224322532263227322832293230323132323233323432353236323732383239324032413242324332443245324632473248324932503251325232533254325532563257325832593260326132623263326432653266326732683269327032713272327332743275327632773278327932803281328232833284328532863287328832893290329132923293329432953296329732983299330033013302330333043305330633073308330933103311331233133314331533163317331833193320332133223323332433253326332733283329333033313332333333343335333633373338333933403341334233433344334533463347334833493350335133523353335433553356335733583359336033613362336333643365336633673368336933703371337233733374337533763377337833793380338133823383338433853386338733883389339033913392339333943395339633973398339934003401340234033404340534063407340834093410341134123413341434153416341734183419342034213422342334243425342634273428342934303431343234333434343534363437343834393440344134423443344434453446344734483449345034513452345334543455345634573458345934603461346234633464346534663467346834693470347134723473347434753476347734783479348034813482348334843485348634873488348934903491349234933494349534963497349834993500350135023503350435053506350735083509351035113512351335143515351635173518351935203521352235233524352535263527352835293530353135323533353435353536353735383539354035413542354335443545354635473548354935503551355235533554355535563557355835593560356135623563356435653566356735683569357035713572357335743575357635773578357935803581358235833584358535863587358835893590359135923593359435953596359735983599360036013602360336043605360636073608360936103611361236133614361536163617361836193620362136223623362436253626362736283629363036313632363336343635363636373638363936403641364236433644364536463647364836493650365136523653365436553656365736583659366036613662366336643665366636673668366936703671367236733674367536763677367836793680368136823683368436853686368736883689369036913692369336943695369636973698369937003701370237033704370537063707370837093710371137123713371437153716371737183719372037213722372337243725372637273728372937303731373237333734373537363737373837393740374137423743374437453746374737483749375037513752375337543755375637573758375937603761376237633764376537663767376837693770377137723773377437753776377737783779378037813782378337843785378637873788378937903791379237933794379537963797379837993800380138023803380438053806380738083809381038113812381338143815381638173818381938203821382238233824382538263827382838293830383138323833383438353836383738383839384038413842384338443845384638473848384938503851385238533854385538563857385838593860386138623863386438653866386738683869387038713872387338743875387638773878387938803881388238833884388538863887388838893890389138923893389438953896389738983899390039013902390339043905390639073908390939103911391239133914391539163917391839193920392139223923392439253926392739283929393039313932393339343935393639373938393939403941394239433944394539463947394839493950395139523953395439553956395739583959396039613962396339643965396639673968396939703971397239733974397539763977397839793980398139823983398439853986398739883989399039913992399339943995399639973998399940004001400240034004400540064007400840094010401140124013401440154016401740184019402040214022402340244025402640274028402940304031403240334034403540364037403840394040404140424043404440454046404740484049405040514052405340544055405640574058405940604061406240634064406540664067406840694070407140724073407440754076407740784079408040814082408340844085408640874088408940904091409240934094409540964097409840994100410141024103410441054106410741084109411041114112411341144115411641174118411941204121412241234124412541264127412841294130413141324133413441354136413741384139414041414142414341444145414641474148414941504151415241534154415541564157415841594160416141624163416441654166416741684169417041714172417341744175417641774178417941804181418241834184418541864187418841894190419141924193419441954196419741984199420042014202420342044205420642074208420942104211421242134214421542164217421842194220422142224223422442254226422742284229423042314232423342344235423642374238423942404241424242434244424542464247424842494250425142524253425442554256425742584259426042614262426342644265426642674268426942704271427242734274427542764277427842794280428142824283428442854286428742884289429042914292429342944295429642974298429943004301430243034304430543064307430843094310431143124313431443154316431743184319432043214322432343244325432643274328432943304331433243334334433543364337433843394340434143424343434443454346434743484349435043514352435343544355435643574358435943604361436243634364436543664367436843694370437143724373437443754376437743784379438043814382438343844385438643874388438943904391439243934394439543964397439843994400440144024403440444054406440744084409441044114412441344144415441644174418441944204421442244234424442544264427442844294430443144324433443444354436443744384439444044414442444344444445444644474448444944504451445244534454445544564457445844594460446144624463446444654466446744684469447044714472447344744475447644774478447944804481448244834484448544864487448844894490449144924493449444954496449744984499450045014502450345044505450645074508450945104511451245134514451545164517451845194520452145224523452445254526452745284529453045314532453345344535453645374538453945404541454245434544454545464547454845494550455145524553455445554556455745584559456045614562456345644565456645674568456945704571457245734574457545764577457845794580458145824583458445854586458745884589459045914592459345944595459645974598459946004601460246034604460546064607460846094610461146124613461446154616461746184619462046214622462346244625462646274628462946304631463246334634463546364637463846394640464146424643464446454646464746484649465046514652465346544655465646574658465946604661466246634664466546664667466846694670467146724673467446754676467746784679468046814682468346844685468646874688468946904691469246934694469546964697469846994700470147024703470447054706470747084709471047114712471347144715471647174718471947204721472247234724472547264727472847294730473147324733473447354736473747384739474047414742474347444745474647474748474947504751475247534754475547564757475847594760476147624763476447654766476747684769477047714772477347744775477647774778477947804781478247834784478547864787478847894790479147924793479447954796479747984799480048014802480348044805480648074808480948104811481248134814481548164817481848194820482148224823482448254826482748284829483048314832483348344835483648374838483948404841484248434844484548464847484848494850485148524853485448554856485748584859486048614862486348644865486648674868486948704871487248734874487548764877487848794880488148824883488448854886488748884889489048914892489348944895489648974898489949004901490249034904490549064907490849094910491149124913491449154916491749184919492049214922492349244925492649274928492949304931493249334934493549364937493849394940494149424943494449454946494749484949495049514952495349544955495649574958495949604961496249634964496549664967496849694970497149724973497449754976497749784979498049814982498349844985498649874988498949904991499249934994499549964997499849995000500150025003500450055006500750085009501050115012501350145015501650175018501950205021502250235024502550265027502850295030503150325033503450355036503750385039504050415042504350445045504650475048504950505051505250535054505550565057505850595060506150625063506450655066506750685069507050715072507350745075507650775078507950805081508250835084508550865087508850895090509150925093509450955096509750985099510051015102510351045105510651075108510951105111511251135114511551165117511851195120512151225123512451255126512751285129513051315132513351345135513651375138513951405141514251435144514551465147514851495150515151525153515451555156515751585159516051615162516351645165516651675168516951705171517251735174517551765177517851795180518151825183518451855186518751885189519051915192519351945195519651975198519952005201520252035204520552065207520852095210521152125213521452155216521752185219522052215222522352245225522652275228522952305231523252335234523552365237523852395240524152425243524452455246524752485249525052515252525352545255525652575258525952605261526252635264526552665267526852695270527152725273527452755276527752785279528052815282528352845285528652875288528952905291529252935294529552965297529852995300530153025303530453055306530753085309531053115312531353145315531653175318531953205321532253235324532553265327532853295330533153325333533453355336533753385339534053415342534353445345534653475348534953505351535253535354535553565357535853595360536153625363536453655366536753685369537053715372537353745375537653775378537953805381538253835384538553865387538853895390539153925393539453955396539753985399540054015402540354045405540654075408540954105411541254135414541554165417541854195420542154225423542454255426542754285429543054315432543354345435543654375438543954405441544254435444544554465447544854495450545154525453545454555456545754585459546054615462546354645465546654675468546954705471547254735474547554765477547854795480548154825483
  1. # ltmain.sh - Provide generalized library-building support services.
  2. # NOTE: Changing this file will not affect anything until you rerun configure.
  3. #
  4. # Copyright (C) 1996, 1997, 1998, 1999, 2000, 2001
  5. # Free Software Foundation, Inc.
  6. # Originally by Gordon Matzigkeit <gord@gnu.ai.mit.edu>, 1996
  7. #
  8. # This program is free software; you can redistribute it and/or modify
  9. # it under the terms of the GNU General Public License as published by
  10. # the Free Software Foundation; either version 2 of the License, or
  11. # (at your option) any later version.
  12. #
  13. # This program is distributed in the hope that it will be useful, but
  14. # WITHOUT ANY WARRANTY; without even the implied warranty of
  15. # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
  16. # General Public License for more details.
  17. #
  18. # You should have received a copy of the GNU General Public License
  19. # along with this program; if not, write to the Free Software
  20. # Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
  21. #
  22. # As a special exception to the GNU General Public License, if you
  23. # distribute this file as part of a program that contains a
  24. # configuration script generated by Autoconf, you may include it under
  25. # the same distribution terms that you use for the rest of that program.
  26. # Check that we have a working $echo.
  27. if test "X$1" = X--no-reexec; then
  28. # Discard the --no-reexec flag, and continue.
  29. shift
  30. elif test "X$1" = X--fallback-echo; then
  31. # Avoid inline document here, it may be left over
  32. :
  33. elif test "X`($echo '\t') 2>/dev/null`" = 'X\t'; then
  34. # Yippee, $echo works!
  35. :
  36. else
  37. # Restart under the correct shell, and then maybe $echo will work.
  38. exec $SHELL "$0" --no-reexec ${1+"$@"}
  39. fi
  40. if test "X$1" = X--fallback-echo; then
  41. # used as fallback echo
  42. shift
  43. cat <<EOF
  44. $*
  45. EOF
  46. exit 0
  47. fi
  48. # The name of this program.
  49. progname=`$echo "$0" | sed 's%^.*/%%'`
  50. modename="$progname"
  51. # Constants.
  52. PROGRAM=ltmain.sh
  53. PACKAGE=libtool
  54. VERSION=1.4b
  55. TIMESTAMP=" (1.971 2001/07/09 22:02:09)"
  56. default_mode=
  57. help="Try \`$progname --help' for more information."
  58. magic="%%%MAGIC variable%%%"
  59. mkdir="mkdir"
  60. mv="mv -f"
  61. rm="rm -f"
  62. # Sed substitution that helps us do robust quoting. It backslashifies
  63. # metacharacters that are still active within double-quoted strings.
  64. Xsed='sed -e 1s/^X//'
  65. sed_quote_subst='s/\([\\`\\"$\\\\]\)/\\\1/g'
  66. SP2NL='tr \040 \012'
  67. NL2SP='tr \015\012 \040\040'
  68. # NLS nuisances.
  69. # Only set LANG and LC_ALL to C if already set.
  70. # These must not be set unconditionally because not all systems understand
  71. # e.g. LANG=C (notably SCO).
  72. # We save the old values to restore during execute mode.
  73. if test "${LC_ALL+set}" = set; then
  74. save_LC_ALL="$LC_ALL"; LC_ALL=C; export LC_ALL
  75. fi
  76. if test "${LANG+set}" = set; then
  77. save_LANG="$LANG"; LANG=C; export LANG
  78. fi
  79. if test "$build_libtool_libs" != yes && test "$build_old_libs" != yes; then
  80. echo "$modename: not configured to build any kind of library" 1>&2
  81. echo "Fatal configuration error. See the $PACKAGE docs for more information." 1>&2
  82. exit 1
  83. fi
  84. # Global variables.
  85. mode=$default_mode
  86. nonopt=
  87. prev=
  88. prevopt=
  89. run=
  90. show="$echo"
  91. show_help=
  92. execute_dlfiles=
  93. lo2o="s/\\.lo\$/.${objext}/"
  94. o2lo="s/\\.${objext}\$/.lo/"
  95. # Parse our command line options once, thoroughly.
  96. while test $# -gt 0
  97. do
  98. arg="$1"
  99. shift
  100. case $arg in
  101. -*=*) optarg=`$echo "X$arg" | $Xsed -e 's/[-_a-zA-Z0-9]*=//'` ;;
  102. *) optarg= ;;
  103. esac
  104. # If the previous option needs an argument, assign it.
  105. if test -n "$prev"; then
  106. case $prev in
  107. execute_dlfiles)
  108. execute_dlfiles="$execute_dlfiles $arg"
  109. ;;
  110. tag)
  111. tagname="$arg"
  112. # Check whether tagname contains only valid characters
  113. case $tagname in
  114. *[!-_A-Za-z0-9,/]*)
  115. echo "$progname: invalid tag name: $tagname" 1>&2
  116. exit 1
  117. ;;
  118. esac
  119. case $tagname in
  120. CC)
  121. # Don't test for the "default" C tag, as we know, it's there, but
  122. # not specially marked.
  123. ;;
  124. *)
  125. if grep "^# ### BEGIN LIBTOOL TAG CONFIG: $tagname$" < "$0" > /dev/null; then
  126. taglist="$taglist $tagname"
  127. # Evaluate the configuration.
  128. eval "`sed -n -e '/^# ### BEGIN LIBTOOL TAG CONFIG: '$tagname'$/,/^# ### END LIBTOOL TAG CONFIG: '$tagname'$/p' < $0`"
  129. else
  130. echo "$progname: ignoring unknown tag $tagname" 1>&2
  131. fi
  132. ;;
  133. esac
  134. ;;
  135. *)
  136. eval "$prev=\$arg"
  137. ;;
  138. esac
  139. prev=
  140. prevopt=
  141. continue
  142. fi
  143. # Have we seen a non-optional argument yet?
  144. case $arg in
  145. --help)
  146. show_help=yes
  147. ;;
  148. --version)
  149. echo "$PROGRAM (GNU $PACKAGE) $VERSION$TIMESTAMP"
  150. echo
  151. echo "Copyright 1996, 1997, 1998, 1999, 2000, 2001"
  152. echo "Free Software Foundation, Inc."
  153. echo "This is free software; see the source for copying conditions. There is NO"
  154. echo "warranty; not even for MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE."
  155. exit 0
  156. ;;
  157. --config)
  158. sed -e '1,/^# ### BEGIN LIBTOOL CONFIG/d' -e '/^# ### END LIBTOOL CONFIG/,$d' $0
  159. # Now print the configurations for the tags.
  160. for tagname in $taglist; do
  161. sed -n -e "/^# ### BEGIN LIBTOOL TAG CONFIG: $tagname$/,/^# ### END LIBTOOL TAG CONFIG: $tagname$/p" < "$0"
  162. done
  163. exit 0
  164. ;;
  165. --debug)
  166. echo "$progname: enabling shell trace mode"
  167. set -x
  168. ;;
  169. --dry-run | -n)
  170. run=:
  171. ;;
  172. --features)
  173. echo "host: $host"
  174. if test "$build_libtool_libs" = yes; then
  175. echo "enable shared libraries"
  176. else
  177. echo "disable shared libraries"
  178. fi
  179. if test "$build_old_libs" = yes; then
  180. echo "enable static libraries"
  181. else
  182. echo "disable static libraries"
  183. fi
  184. exit 0
  185. ;;
  186. --finish) mode="finish" ;;
  187. --mode) prevopt="--mode" prev=mode ;;
  188. --mode=*) mode="$optarg" ;;
  189. --quiet | --silent)
  190. show=:
  191. ;;
  192. --tag) prevopt="--tag" prev=tag ;;
  193. --tag=*)
  194. set tag "$optarg" ${1+"$@"}
  195. shift
  196. prev=tag
  197. ;;
  198. -dlopen)
  199. prevopt="-dlopen"
  200. prev=execute_dlfiles
  201. ;;
  202. -*)
  203. $echo "$modename: unrecognized option \`$arg'" 1>&2
  204. $echo "$help" 1>&2
  205. exit 1
  206. ;;
  207. *)
  208. nonopt="$arg"
  209. break
  210. ;;
  211. esac
  212. done
  213. if test -n "$prevopt"; then
  214. $echo "$modename: option \`$prevopt' requires an argument" 1>&2
  215. $echo "$help" 1>&2
  216. exit 1
  217. fi
  218. # If this variable is set in any of the actions, the command in it
  219. # will be execed at the end. This prevents here-documents from being
  220. # left over by shells.
  221. exec_cmd=
  222. if test -z "$show_help"; then
  223. # Infer the operation mode.
  224. if test -z "$mode"; then
  225. case $nonopt in
  226. *cc | *++ | gcc* | *-gcc*)
  227. mode=link
  228. for arg
  229. do
  230. case $arg in
  231. -c)
  232. mode=compile
  233. break
  234. ;;
  235. esac
  236. done
  237. ;;
  238. *db | *dbx | *strace | *truss)
  239. mode=execute
  240. ;;
  241. *install*|cp|mv)
  242. mode=install
  243. ;;
  244. *rm)
  245. mode=uninstall
  246. ;;
  247. *)
  248. # If we have no mode, but dlfiles were specified, then do execute mode.
  249. test -n "$execute_dlfiles" && mode=execute
  250. # Just use the default operation mode.
  251. if test -z "$mode"; then
  252. if test -n "$nonopt"; then
  253. $echo "$modename: warning: cannot infer operation mode from \`$nonopt'" 1>&2
  254. else
  255. $echo "$modename: warning: cannot infer operation mode without MODE-ARGS" 1>&2
  256. fi
  257. fi
  258. ;;
  259. esac
  260. fi
  261. # Only execute mode is allowed to have -dlopen flags.
  262. if test -n "$execute_dlfiles" && test "$mode" != execute; then
  263. $echo "$modename: unrecognized option \`-dlopen'" 1>&2
  264. $echo "$help" 1>&2
  265. exit 1
  266. fi
  267. # Change the help message to a mode-specific one.
  268. generic_help="$help"
  269. help="Try \`$modename --help --mode=$mode' for more information."
  270. # These modes are in order of execution frequency so that they run quickly.
  271. case $mode in
  272. # libtool compile mode
  273. compile)
  274. modename="$modename: compile"
  275. # Get the compilation command and the source file.
  276. base_compile=
  277. prev=
  278. lastarg=
  279. srcfile="$nonopt"
  280. suppress_output=
  281. user_target=no
  282. for arg
  283. do
  284. case $prev in
  285. "") ;;
  286. xcompiler)
  287. # Aesthetically quote the previous argument.
  288. prev=
  289. lastarg=`$echo "X$arg" | $Xsed -e "$sed_quote_subst"`
  290. case $arg in
  291. # Double-quote args containing other shell metacharacters.
  292. # Many Bourne shells cannot handle close brackets correctly
  293. # in scan sets, so we specify it separately.
  294. *[\[\~\#\^\&\*\(\)\{\}\|\;\<\>\?\'\ \ ]*|*]*|"")
  295. arg="\"$arg\""
  296. ;;
  297. esac
  298. # Add the previous argument to base_compile.
  299. if test -z "$base_compile"; then
  300. base_compile="$lastarg"
  301. else
  302. base_compile="$base_compile $lastarg"
  303. fi
  304. continue
  305. ;;
  306. esac
  307. # Accept any command-line options.
  308. case $arg in
  309. -o)
  310. if test "$user_target" != "no"; then
  311. $echo "$modename: you cannot specify \`-o' more than once" 1>&2
  312. exit 1
  313. fi
  314. user_target=next
  315. ;;
  316. -static)
  317. build_old_libs=yes
  318. continue
  319. ;;
  320. -prefer-pic)
  321. pic_mode=yes
  322. continue
  323. ;;
  324. -prefer-non-pic)
  325. pic_mode=no
  326. continue
  327. ;;
  328. -Xcompiler)
  329. prev=xcompiler
  330. continue
  331. ;;
  332. -Wc,*)
  333. args=`$echo "X$arg" | $Xsed -e "s/^-Wc,//"`
  334. lastarg=
  335. IFS="${IFS= }"; save_ifs="$IFS"; IFS=','
  336. for arg in $args; do
  337. IFS="$save_ifs"
  338. # Double-quote args containing other shell metacharacters.
  339. # Many Bourne shells cannot handle close brackets correctly
  340. # in scan sets, so we specify it separately.
  341. case $arg in
  342. *[\[\~\#\^\&\*\(\)\{\}\|\;\<\>\?\'\ \ ]*|*]*|"")
  343. arg="\"$arg\""
  344. ;;
  345. esac
  346. lastarg="$lastarg $arg"
  347. done
  348. IFS="$save_ifs"
  349. lastarg=`$echo "X$lastarg" | $Xsed -e "s/^ //"`
  350. # Add the arguments to base_compile.
  351. if test -z "$base_compile"; then
  352. base_compile="$lastarg"
  353. else
  354. base_compile="$base_compile $lastarg"
  355. fi
  356. continue
  357. ;;
  358. esac
  359. case $user_target in
  360. next)
  361. # The next one is the -o target name
  362. user_target=yes
  363. continue
  364. ;;
  365. yes)
  366. # We got the output file
  367. user_target=set
  368. libobj="$arg"
  369. continue
  370. ;;
  371. esac
  372. # Accept the current argument as the source file.
  373. lastarg="$srcfile"
  374. srcfile="$arg"
  375. # Aesthetically quote the previous argument.
  376. # Backslashify any backslashes, double quotes, and dollar signs.
  377. # These are the only characters that are still specially
  378. # interpreted inside of double-quoted scrings.
  379. lastarg=`$echo "X$lastarg" | $Xsed -e "$sed_quote_subst"`
  380. # Double-quote args containing other shell metacharacters.
  381. # Many Bourne shells cannot handle close brackets correctly
  382. # in scan sets, so we specify it separately.
  383. case $lastarg in
  384. *[\[\~\#\^\&\*\(\)\{\}\|\;\<\>\?\'\ \ ]*|*]*|"")
  385. lastarg="\"$lastarg\""
  386. ;;
  387. esac
  388. # Add the previous argument to base_compile.
  389. if test -z "$base_compile"; then
  390. base_compile="$lastarg"
  391. else
  392. base_compile="$base_compile $lastarg"
  393. fi
  394. done
  395. case $user_target in
  396. set)
  397. ;;
  398. no)
  399. # Get the name of the library object.
  400. libobj=`$echo "X$srcfile" | $Xsed -e 's%^.*/%%'`
  401. ;;
  402. *)
  403. $echo "$modename: you must specify a target with \`-o'" 1>&2
  404. exit 1
  405. ;;
  406. esac
  407. # Recognize several different file suffixes.
  408. # If the user specifies -o file.o, it is replaced with file.lo
  409. xform='[cCFSifmso]'
  410. case $libobj in
  411. *.ada) xform=ada ;;
  412. *.adb) xform=adb ;;
  413. *.ads) xform=ads ;;
  414. *.asm) xform=asm ;;
  415. *.c++) xform=c++ ;;
  416. *.cc) xform=cc ;;
  417. *.ii) xform=ii ;;
  418. *.class) xform=class ;;
  419. *.cpp) xform=cpp ;;
  420. *.cxx) xform=cxx ;;
  421. *.f90) xform=f90 ;;
  422. *.for) xform=for ;;
  423. *.java) xform=java ;;
  424. esac
  425. libobj=`$echo "X$libobj" | $Xsed -e "s/\.$xform$/.lo/"`
  426. case $libobj in
  427. *.lo) obj=`$echo "X$libobj" | $Xsed -e "$lo2o"` ;;
  428. *)
  429. $echo "$modename: cannot determine name of library object from \`$libobj'" 1>&2
  430. exit 1
  431. ;;
  432. esac
  433. # Infer tagged configuration to use if any are available and
  434. # if one wasn't chosen via the "--tag" command line option.
  435. # Only attempt this if the compiler in the base compile
  436. # command doesn't match the default compiler.
  437. if test -n "$available_tags" && test -z "$tagname"; then
  438. case $base_compile in
  439. "$CC "*) ;;
  440. # Blanks in the command may have been stripped by the calling shell,
  441. # but not from the CC environment variable when ltconfig was run.
  442. "`$echo $CC` "*) ;;
  443. *)
  444. for z in $available_tags; do
  445. if grep "^# ### BEGIN LIBTOOL TAG CONFIG: $z$" < "$0" > /dev/null; then
  446. # Evaluate the configuration.
  447. eval "`sed -n -e '/^# ### BEGIN LIBTOOL TAG CONFIG: '$z'$/,/^# ### END LIBTOOL TAG CONFIG: '$z'$/p' < $0`"
  448. case $base_compile in
  449. "$CC "*)
  450. # The compiler in the base compile command matches
  451. # the one in the tagged configuration.
  452. # Assume this is the tagged configuration we want.
  453. tagname=$z
  454. break
  455. ;;
  456. "`$echo $CC` "*)
  457. tagname=$z
  458. break
  459. ;;
  460. esac
  461. fi
  462. done
  463. # If $tagname still isn't set, then no tagged configuration
  464. # was found and let the user know that the "--tag" command
  465. # line option must be used.
  466. if test -z "$tagname"; then
  467. echo "$modename: unable to infer tagged configuration"
  468. echo "$modename: specify a tag with \`--tag'" 1>&2
  469. exit 1
  470. # else
  471. # echo "$modename: using $tagname tagged configuration"
  472. fi
  473. ;;
  474. esac
  475. fi
  476. objname=`$echo "X$obj" | $Xsed -e 's%^.*/%%'`
  477. xdir=`$echo "X$obj" | $Xsed -e 's%/[^/]*$%%'`
  478. if test "X$xdir" = "X$obj"; then
  479. xdir=
  480. else
  481. xdir=$xdir/
  482. fi
  483. lobj=${xdir}$objdir/$objname
  484. if test -z "$base_compile"; then
  485. $echo "$modename: you must specify a compilation command" 1>&2
  486. $echo "$help" 1>&2
  487. exit 1
  488. fi
  489. # Delete any leftover library objects.
  490. if test "$build_old_libs" = yes; then
  491. removelist="$obj $lobj $libobj ${libobj}T"
  492. else
  493. removelist="$lobj $libobj ${libobj}T"
  494. fi
  495. $run $rm $removelist
  496. trap "$run $rm $removelist; exit 1" 1 2 15
  497. # On Cygwin there's no "real" PIC flag so we must build both object types
  498. case $host_os in
  499. cygwin* | mingw* | pw32* | os2*)
  500. pic_mode=default
  501. ;;
  502. esac
  503. if test "$pic_mode" = no && test "$deplibs_check_method" != pass_all; then
  504. # non-PIC code in shared libraries is not supported
  505. pic_mode=default
  506. fi
  507. # Calculate the filename of the output object if compiler does
  508. # not support -o with -c
  509. if test "$compiler_c_o" = no; then
  510. output_obj=`$echo "X$srcfile" | $Xsed -e 's%^.*/%%' -e 's%\.[^.]*$%%'`.${objext}
  511. lockfile="$output_obj.lock"
  512. removelist="$removelist $output_obj $lockfile"
  513. trap "$run $rm $removelist; exit 1" 1 2 15
  514. else
  515. output_obj=
  516. need_locks=no
  517. lockfile=
  518. fi
  519. # Lock this critical section if it is needed
  520. # We use this script file to make the link, it avoids creating a new file
  521. if test "$need_locks" = yes; then
  522. until $run ln "$0" "$lockfile" 2>/dev/null; do
  523. $show "Waiting for $lockfile to be removed"
  524. sleep 2
  525. done
  526. elif test "$need_locks" = warn; then
  527. if test -f "$lockfile"; then
  528. echo "\
  529. *** ERROR, $lockfile exists and contains:
  530. `cat $lockfile 2>/dev/null`
  531. This indicates that another process is trying to use the same
  532. temporary object file, and libtool could not work around it because
  533. your compiler does not support \`-c' and \`-o' together. If you
  534. repeat this compilation, it may succeed, by chance, but you had better
  535. avoid parallel builds (make -j) in this platform, or get a better
  536. compiler."
  537. $run $rm $removelist
  538. exit 1
  539. fi
  540. echo $srcfile > "$lockfile"
  541. fi
  542. if test -n "$fix_srcfile_path"; then
  543. eval srcfile=\"$fix_srcfile_path\"
  544. fi
  545. $run $rm "$libobj" "${libobj}T"
  546. # Create a libtool object file (analogous to a ".la" file),
  547. # but don't create it if we're doing a dry run.
  548. test -z "$run" && cat > ${libobj}T <<EOF
  549. # $libobj - a libtool object file
  550. # Generated by $PROGRAM - GNU $PACKAGE $VERSION$TIMESTAMP
  551. #
  552. # Please DO NOT delete this file!
  553. # It is necessary for linking the library.
  554. # Name of the PIC object.
  555. EOF
  556. # Only build a PIC object if we are building libtool libraries.
  557. if test "$build_libtool_libs" = yes; then
  558. # Without this assignment, base_compile gets emptied.
  559. fbsd_hideous_sh_bug=$base_compile
  560. if test "$pic_mode" != no; then
  561. command="$base_compile $srcfile $pic_flag"
  562. else
  563. # Don't build PIC code
  564. command="$base_compile $srcfile"
  565. fi
  566. if test ! -d ${xdir}$objdir; then
  567. $show "$mkdir ${xdir}$objdir"
  568. $run $mkdir ${xdir}$objdir
  569. status=$?
  570. if test $status -ne 0 && test ! -d ${xdir}$objdir; then
  571. exit $status
  572. fi
  573. fi
  574. if test -z "$output_obj"; then
  575. # Place PIC objects in $objdir
  576. command="$command -o $lobj"
  577. fi
  578. $run $rm "$lobj" "$output_obj"
  579. $show "$command"
  580. if $run eval "$command"; then :
  581. else
  582. test -n "$output_obj" && $run $rm $removelist
  583. exit 1
  584. fi
  585. if test "$need_locks" = warn &&
  586. test x"`cat $lockfile 2>/dev/null`" != x"$srcfile"; then
  587. echo "\
  588. *** ERROR, $lockfile contains:
  589. `cat $lockfile 2>/dev/null`
  590. but it should contain:
  591. $srcfile
  592. This indicates that another process is trying to use the same
  593. temporary object file, and libtool could not work around it because
  594. your compiler does not support \`-c' and \`-o' together. If you
  595. repeat this compilation, it may succeed, by chance, but you had better
  596. avoid parallel builds (make -j) in this platform, or get a better
  597. compiler."
  598. $run $rm $removelist
  599. exit 1
  600. fi
  601. # Just move the object if needed, then go on to compile the next one
  602. if test -n "$output_obj" && test "x$output_obj" != "x$lobj"; then
  603. $show "$mv $output_obj $lobj"
  604. if $run $mv $output_obj $lobj; then :
  605. else
  606. error=$?
  607. $run $rm $removelist
  608. exit $error
  609. fi
  610. fi
  611. # Append the name of the PIC object to the libtool object file.
  612. test -z "$run" && cat >> ${libobj}T <<EOF
  613. pic_object='$objdir/$objname'
  614. EOF
  615. # Allow error messages only from the first compilation.
  616. suppress_output=' >/dev/null 2>&1'
  617. else
  618. # No PIC object so indicate it doesn't exist in the libtool
  619. # object file.
  620. test -z "$run" && cat >> ${libobj}T <<EOF
  621. pic_object=none
  622. EOF
  623. fi
  624. # Only build a position-dependent object if we build old libraries.
  625. if test "$build_old_libs" = yes; then
  626. if test "$pic_mode" != yes; then
  627. # Don't build PIC code
  628. command="$base_compile $srcfile"
  629. else
  630. command="$base_compile $srcfile $pic_flag"
  631. fi
  632. if test "$compiler_c_o" = yes; then
  633. command="$command -o $obj"
  634. fi
  635. # Suppress compiler output if we already did a PIC compilation.
  636. command="$command$suppress_output"
  637. $run $rm "$obj" "$output_obj"
  638. $show "$command"
  639. if $run eval "$command"; then :
  640. else
  641. $run $rm $removelist
  642. exit 1
  643. fi
  644. if test "$need_locks" = warn &&
  645. test x"`cat $lockfile 2>/dev/null`" != x"$srcfile"; then
  646. echo "\
  647. *** ERROR, $lockfile contains:
  648. `cat $lockfile 2>/dev/null`
  649. but it should contain:
  650. $srcfile
  651. This indicates that another process is trying to use the same
  652. temporary object file, and libtool could not work around it because
  653. your compiler does not support \`-c' and \`-o' together. If you
  654. repeat this compilation, it may succeed, by chance, but you had better
  655. avoid parallel builds (make -j) in this platform, or get a better
  656. compiler."
  657. $run $rm $removelist
  658. exit 1
  659. fi
  660. # Just move the object if needed
  661. if test -n "$output_obj" && test "x$output_obj" != "x$obj"; then
  662. $show "$mv $output_obj $obj"
  663. if $run $mv $output_obj $obj; then :
  664. else
  665. error=$?
  666. $run $rm $removelist
  667. exit $error
  668. fi
  669. fi
  670. # Append the name of the non-PIC object the libtool object file.
  671. # Only append if the libtool object file exists.
  672. test -z "$run" && cat >> ${libobj}T <<EOF
  673. # Name of the non-PIC object.
  674. non_pic_object='$objname'
  675. EOF
  676. else
  677. # Append the name of the non-PIC object the libtool object file.
  678. # Only append if the libtool object file exists.
  679. test -z "$run" && cat >> ${libobj}T <<EOF
  680. # Name of the non-PIC object.
  681. non_pic_object=none
  682. EOF
  683. fi
  684. $run $mv "${libobj}T" "${libobj}"
  685. # Unlock the critical section if it was locked
  686. if test "$need_locks" != no; then
  687. $run $rm "$lockfile"
  688. fi
  689. exit 0
  690. ;;
  691. # libtool link mode
  692. link | relink)
  693. modename="$modename: link"
  694. case $host in
  695. *-*-cygwin* | *-*-mingw* | *-*-pw32* | *-*-os2*)
  696. # It is impossible to link a dll without this setting, and
  697. # we shouldn't force the makefile maintainer to figure out
  698. # which system we are compiling for in order to pass an extra
  699. # flag for every libtool invokation.
  700. # allow_undefined=no
  701. # FIXME: Unfortunately, there are problems with the above when trying
  702. # to make a dll which has undefined symbols, in which case not
  703. # even a static library is built. For now, we need to specify
  704. # -no-undefined on the libtool link line when we can be certain
  705. # that all symbols are satisfied, otherwise we get a static library.
  706. allow_undefined=yes
  707. ;;
  708. *)
  709. allow_undefined=yes
  710. ;;
  711. esac
  712. libtool_args="$nonopt"
  713. base_compile="$nonopt"
  714. compile_command="$nonopt"
  715. finalize_command="$nonopt"
  716. compile_rpath=
  717. finalize_rpath=
  718. compile_shlibpath=
  719. finalize_shlibpath=
  720. convenience=
  721. old_convenience=
  722. deplibs=
  723. old_deplibs=
  724. compiler_flags=
  725. linker_flags=
  726. dllsearchpath=
  727. lib_search_path=`pwd`
  728. avoid_version=no
  729. dlfiles=
  730. dlprefiles=
  731. dlself=no
  732. export_dynamic=no
  733. export_symbols=
  734. export_symbols_regex=
  735. generated=
  736. libobjs=
  737. ltlibs=
  738. module=no
  739. no_install=no
  740. objs=
  741. non_pic_objects=
  742. prefer_static_libs=no
  743. preload=no
  744. prev=
  745. prevarg=
  746. release=
  747. rpath=
  748. xrpath=
  749. perm_rpath=
  750. temp_rpath=
  751. thread_safe=no
  752. vinfo=
  753. # We need to know -static, to get the right output filenames.
  754. for arg
  755. do
  756. case $arg in
  757. -all-static | -static)
  758. if test "X$arg" = "X-all-static"; then
  759. if test "$build_libtool_libs" = yes && test -z "$link_static_flag"; then
  760. $echo "$modename: warning: complete static linking is impossible in this configuration" 1>&2
  761. fi
  762. if test -n "$link_static_flag"; then
  763. dlopen_self=$dlopen_self_static
  764. fi
  765. else
  766. if test -z "$pic_flag" && test -n "$link_static_flag"; then
  767. dlopen_self=$dlopen_self_static
  768. fi
  769. fi
  770. build_libtool_libs=no
  771. build_old_libs=yes
  772. prefer_static_libs=yes
  773. break
  774. ;;
  775. esac
  776. done
  777. # See if our shared archives depend on static archives.
  778. test -n "$old_archive_from_new_cmds" && build_old_libs=yes
  779. # Go through the arguments, transforming them on the way.
  780. while test $# -gt 0; do
  781. arg="$1"
  782. base_compile="$base_compile $arg"
  783. shift
  784. case $arg in
  785. *[\[\~\#\^\&\*\(\)\{\}\|\;\<\>\?\'\ \ ]*|*]*|"")
  786. qarg=\"`$echo "X$arg" | $Xsed -e "$sed_quote_subst"`\" ### testsuite: skip nested quoting test
  787. ;;
  788. *) qarg=$arg ;;
  789. esac
  790. libtool_args="$libtool_args $qarg"
  791. # If the previous option needs an argument, assign it.
  792. if test -n "$prev"; then
  793. case $prev in
  794. output)
  795. compile_command="$compile_command @OUTPUT@"
  796. finalize_command="$finalize_command @OUTPUT@"
  797. ;;
  798. esac
  799. case $prev in
  800. dlfiles|dlprefiles)
  801. if test "$preload" = no; then
  802. # Add the symbol object into the linking commands.
  803. compile_command="$compile_command @SYMFILE@"
  804. finalize_command="$finalize_command @SYMFILE@"
  805. preload=yes
  806. fi
  807. case $arg in
  808. *.la | *.lo) ;; # We handle these cases below.
  809. force)
  810. if test "$dlself" = no; then
  811. dlself=needless
  812. export_dynamic=yes
  813. fi
  814. prev=
  815. continue
  816. ;;
  817. self)
  818. if test "$prev" = dlprefiles; then
  819. dlself=yes
  820. elif test "$prev" = dlfiles && test "$dlopen_self" != yes; then
  821. dlself=yes
  822. else
  823. dlself=needless
  824. export_dynamic=yes
  825. fi
  826. prev=
  827. continue
  828. ;;
  829. *)
  830. if test "$prev" = dlfiles; then
  831. dlfiles="$dlfiles $arg"
  832. else
  833. dlprefiles="$dlprefiles $arg"
  834. fi
  835. prev=
  836. continue
  837. ;;
  838. esac
  839. ;;
  840. expsyms)
  841. export_symbols="$arg"
  842. if test ! -f "$arg"; then
  843. $echo "$modename: symbol file \`$arg' does not exist"
  844. exit 1
  845. fi
  846. prev=
  847. continue
  848. ;;
  849. expsyms_regex)
  850. export_symbols_regex="$arg"
  851. prev=
  852. continue
  853. ;;
  854. release)
  855. release="-$arg"
  856. prev=
  857. continue
  858. ;;
  859. objectlist)
  860. if test -f "$arg"; then
  861. save_arg=$arg
  862. moreargs=
  863. for fil in `cat $save_arg`
  864. do
  865. # moreargs="$moreargs $fil"
  866. arg=$fil
  867. # A libtool-controlled object.
  868. # Check to see that this really is a libtool object.
  869. if (sed -e '2q' $arg | egrep "^# Generated by .*$PACKAGE") >/dev/null 2>&1; then
  870. pic_object=
  871. non_pic_object=
  872. # Read the .lo file
  873. # If there is no directory component, then add one.
  874. case $arg in
  875. */* | *\\*) . $arg ;;
  876. *) . ./$arg ;;
  877. esac
  878. if test -z "$pic_object" || \
  879. test -z "$non_pic_object" ||
  880. test "$pic_object" = none && \
  881. test "$non_pic_object" = none; then
  882. $echo "$modename: cannot find name of object for \`$arg'" 1>&2
  883. exit 1
  884. fi
  885. # Extract subdirectory from the argument.
  886. xdir=`$echo "X$arg" | $Xsed -e 's%/[^/]*$%%'`
  887. if test "X$xdir" = "X$arg"; then
  888. xdir=
  889. else
  890. xdir="$xdir/"
  891. fi
  892. if test "$pic_object" != none; then
  893. # Prepend the subdirectory the object is found in.
  894. pic_object="$xdir$pic_object"
  895. if test "$prev" = dlfiles; then
  896. if test "$build_libtool_libs" = yes && test "$dlopen_support" = yes; then
  897. dlfiles="$dlfiles $pic_object"
  898. prev=
  899. continue
  900. else
  901. # If libtool objects are unsupported, then we need to preload.
  902. prev=dlprefiles
  903. fi
  904. fi
  905. # CHECK ME: I think I busted this. -Ossama
  906. if test "$prev" = dlprefiles; then
  907. # Preload the old-style object.
  908. dlprefiles="$dlprefiles $pic_object"
  909. prev=
  910. fi
  911. # A PIC object.
  912. libobjs="$libobjs $pic_object"
  913. arg="$pic_object"
  914. fi
  915. # Non-PIC object.
  916. if test "$non_pic_object" != none; then
  917. # Prepend the subdirectory the object is found in.
  918. non_pic_object="$xdir$non_pic_object"
  919. # A standard non-PIC object
  920. non_pic_objects="$non_pic_objects $non_pic_object"
  921. if test -z "$pic_object" || test "$pic_object" = none ; then
  922. arg="$non_pic_object"
  923. fi
  924. fi
  925. else
  926. # Only an error if not doing a dry-run.
  927. if test -z "$run"; then
  928. $echo "$modename: \`$arg' is not a valid libtool object" 1>&2
  929. exit 1
  930. else
  931. # Dry-run case.
  932. # Extract subdirectory from the argument.
  933. xdir=`$echo "X$arg" | $Xsed -e 's%/[^/]*$%%'`
  934. if test "X$xdir" = "X$arg"; then
  935. xdir=
  936. else
  937. xdir="$xdir/"
  938. fi
  939. pic_object=`$echo "X${xdir}${objdir}/${arg}" | $Xsed -e "$lo2o"`
  940. non_pic_object=`$echo "X${xdir}${arg}" | $Xsed -e "$lo2o"`
  941. libobjs="$libobjs $pic_object"
  942. non_pic_objects="$non_pic_objects $non_pic_object"
  943. fi
  944. fi
  945. done
  946. else
  947. $echo "$modename: link input file \`$save_arg' does not exist"
  948. exit 1
  949. fi
  950. arg=$save_arg
  951. prev=
  952. continue
  953. ;;
  954. rpath | xrpath)
  955. # We need an absolute path.
  956. case $arg in
  957. [\\/]* | [A-Za-z]:[\\/]*) ;;
  958. *)
  959. $echo "$modename: only absolute run-paths are allowed" 1>&2
  960. exit 1
  961. ;;
  962. esac
  963. if test "$prev" = rpath; then
  964. case "$rpath " in
  965. *" $arg "*) ;;
  966. *) rpath="$rpath $arg" ;;
  967. esac
  968. else
  969. case "$xrpath " in
  970. *" $arg "*) ;;
  971. *) xrpath="$xrpath $arg" ;;
  972. esac
  973. fi
  974. prev=
  975. continue
  976. ;;
  977. xcompiler)
  978. compiler_flags="$compiler_flags $qarg"
  979. prev=
  980. compile_command="$compile_command $qarg"
  981. finalize_command="$finalize_command $qarg"
  982. continue
  983. ;;
  984. xlinker)
  985. linker_flags="$linker_flags $qarg"
  986. compiler_flags="$compiler_flags $wl$qarg"
  987. prev=
  988. compile_command="$compile_command $wl$qarg"
  989. finalize_command="$finalize_command $wl$qarg"
  990. continue
  991. ;;
  992. *)
  993. eval "$prev=\"\$arg\""
  994. prev=
  995. continue
  996. ;;
  997. esac
  998. fi # test -n $prev
  999. prevarg="$arg"
  1000. case $arg in
  1001. -all-static)
  1002. if test -n "$link_static_flag"; then
  1003. compile_command="$compile_command $link_static_flag"
  1004. finalize_command="$finalize_command $link_static_flag"
  1005. fi
  1006. continue
  1007. ;;
  1008. -allow-undefined)
  1009. # FIXME: remove this flag sometime in the future.
  1010. $echo "$modename: \`-allow-undefined' is deprecated because it is the default" 1>&2
  1011. continue
  1012. ;;
  1013. -avoid-version)
  1014. avoid_version=yes
  1015. continue
  1016. ;;
  1017. -dlopen)
  1018. prev=dlfiles
  1019. continue
  1020. ;;
  1021. -dlpreopen)
  1022. prev=dlprefiles
  1023. continue
  1024. ;;
  1025. -export-dynamic)
  1026. export_dynamic=yes
  1027. continue
  1028. ;;
  1029. -export-symbols | -export-symbols-regex)
  1030. if test -n "$export_symbols" || test -n "$export_symbols_regex"; then
  1031. $echo "$modename: more than one -exported-symbols argument is not allowed"
  1032. exit 1
  1033. fi
  1034. if test "X$arg" = "X-export-symbols"; then
  1035. prev=expsyms
  1036. else
  1037. prev=expsyms_regex
  1038. fi
  1039. continue
  1040. ;;
  1041. # The native IRIX linker understands -LANG:*, -LIST:* and -LNO:*
  1042. # so, if we see these flags be careful not to treat them like -L
  1043. -L[A-Z][A-Z]*:*)
  1044. case $with_gcc/$host in
  1045. no/*-*-irix*)
  1046. compile_command="$compile_command $arg"
  1047. finalize_command="$finalize_command $arg"
  1048. ;;
  1049. esac
  1050. continue
  1051. ;;
  1052. -L*)
  1053. dir=`$echo "X$arg" | $Xsed -e 's/^-L//'`
  1054. # We need an absolute path.
  1055. case $dir in
  1056. [\\/]* | [A-Za-z]:[\\/]*) ;;
  1057. *)
  1058. absdir=`cd "$dir" && pwd`
  1059. if test -z "$absdir"; then
  1060. $echo "$modename: cannot determine absolute directory name of \`$dir'" 1>&2
  1061. exit 1
  1062. fi
  1063. dir="$absdir"
  1064. ;;
  1065. esac
  1066. case "$deplibs " in
  1067. *" -L$dir "*) ;;
  1068. *)
  1069. deplibs="$deplibs -L$dir"
  1070. lib_search_path="$lib_search_path $dir"
  1071. ;;
  1072. esac
  1073. case $host in
  1074. *-*-cygwin* | *-*-mingw* | *-*-pw32* | *-*-os2*)
  1075. case :$dllsearchpath: in
  1076. *":$dir:"*) ;;
  1077. *) dllsearchpath="$dllsearchpath:$dir";;
  1078. esac
  1079. ;;
  1080. esac
  1081. continue
  1082. ;;
  1083. -l*)
  1084. if test "X$arg" = "X-lc" || test "X$arg" = "X-lm"; then
  1085. case $host in
  1086. *-*-cygwin* | *-*-pw32* | *-*-beos*)
  1087. # These systems don't actually have a C or math library (as such)
  1088. continue
  1089. ;;
  1090. *-*-mingw* | *-*-os2*)
  1091. # These systems don't actually have a C library (as such)
  1092. test "X$arg" = "X-lc" && continue
  1093. ;;
  1094. *-*-openbsd*)
  1095. # OpenBSD uses either libc or libc_r.
  1096. continue
  1097. ;;
  1098. *-*-rhapsody* | *-*-darwin1.[012])
  1099. # Rhapsody C and math libraries are in the System framework
  1100. deplibs="$deplibs -framework System"
  1101. continue
  1102. esac
  1103. fi
  1104. if test "X$arg" = "X-lc_r"; then
  1105. case $host in
  1106. *-*-openbsd*)
  1107. # Do not include libc_r directly, use -pthread flag.
  1108. continue
  1109. ;;
  1110. esac
  1111. fi
  1112. deplibs="$deplibs $arg"
  1113. continue
  1114. ;;
  1115. -module)
  1116. module=yes
  1117. continue
  1118. ;;
  1119. -no-fast-install)
  1120. fast_install=no
  1121. continue
  1122. ;;
  1123. -no-install)
  1124. case $host in
  1125. *-*-cygwin* | *-*-mingw* | *-*-pw32* | *-*-os2*)
  1126. # The PATH hackery in wrapper scripts is required on Windows
  1127. # in order for the loader to find any dlls it needs.
  1128. $echo "$modename: warning: \`-no-install' is ignored for $host" 1>&2
  1129. $echo "$modename: warning: assuming \`-no-fast-install' instead" 1>&2
  1130. fast_install=no
  1131. ;;
  1132. *) no_install=yes ;;
  1133. esac
  1134. continue
  1135. ;;
  1136. -no-undefined)
  1137. allow_undefined=no
  1138. continue
  1139. ;;
  1140. -objectlist)
  1141. prev=objectlist
  1142. continue
  1143. ;;
  1144. -o) prev=output ;;
  1145. -release)
  1146. prev=release
  1147. continue
  1148. ;;
  1149. -rpath)
  1150. prev=rpath
  1151. continue
  1152. ;;
  1153. -R)
  1154. prev=xrpath
  1155. continue
  1156. ;;
  1157. -R*)
  1158. dir=`$echo "X$arg" | $Xsed -e 's/^-R//'`
  1159. # We need an absolute path.
  1160. case $dir in
  1161. [\\/]* | [A-Za-z]:[\\/]*) ;;
  1162. *)
  1163. $echo "$modename: only absolute run-paths are allowed" 1>&2
  1164. exit 1
  1165. ;;
  1166. esac
  1167. case "$xrpath " in
  1168. *" $dir "*) ;;
  1169. *) xrpath="$xrpath $dir" ;;
  1170. esac
  1171. continue
  1172. ;;
  1173. -static)
  1174. # The effects of -static are defined in a previous loop.
  1175. # We used to do the same as -all-static on platforms that
  1176. # didn't have a PIC flag, but the assumption that the effects
  1177. # would be equivalent was wrong. It would break on at least
  1178. # Digital Unix and AIX.
  1179. continue
  1180. ;;
  1181. -thread-safe)
  1182. thread_safe=yes
  1183. continue
  1184. ;;
  1185. -version-info)
  1186. prev=vinfo
  1187. continue
  1188. ;;
  1189. -Wc,*)
  1190. args=`$echo "X$arg" | $Xsed -e "$sed_quote_subst" -e 's/^-Wc,//'`
  1191. arg=
  1192. IFS="${IFS= }"; save_ifs="$IFS"; IFS=','
  1193. for flag in $args; do
  1194. IFS="$save_ifs"
  1195. case $flag in
  1196. *[\[\~\#\^\&\*\(\)\{\}\|\;\<\>\?\'\ \ ]*|*]*|"")
  1197. flag="\"$flag\""
  1198. ;;
  1199. esac
  1200. arg="$arg $wl$flag"
  1201. compiler_flags="$compiler_flags $flag"
  1202. done
  1203. IFS="$save_ifs"
  1204. arg=`$echo "X$arg" | $Xsed -e "s/^ //"`
  1205. ;;
  1206. -Wl,*)
  1207. args=`$echo "X$arg" | $Xsed -e "$sed_quote_subst" -e 's/^-Wl,//'`
  1208. arg=
  1209. IFS="${IFS= }"; save_ifs="$IFS"; IFS=','
  1210. for flag in $args; do
  1211. IFS="$save_ifs"
  1212. case $flag in
  1213. *[\[\~\#\^\&\*\(\)\{\}\|\;\<\>\?\'\ \ ]*|*]*|"")
  1214. flag="\"$flag\""
  1215. ;;
  1216. esac
  1217. arg="$arg $wl$flag"
  1218. compiler_flags="$compiler_flags $wl$flag"
  1219. linker_flags="$linker_flags $flag"
  1220. done
  1221. IFS="$save_ifs"
  1222. arg=`$echo "X$arg" | $Xsed -e "s/^ //"`
  1223. ;;
  1224. -Xcompiler)
  1225. prev=xcompiler
  1226. continue
  1227. ;;
  1228. -Xlinker)
  1229. prev=xlinker
  1230. continue
  1231. ;;
  1232. # Some other compiler flag.
  1233. -* | +*)
  1234. # Unknown arguments in both finalize_command and compile_command need
  1235. # to be aesthetically quoted because they are evaled later.
  1236. arg=`$echo "X$arg" | $Xsed -e "$sed_quote_subst"`
  1237. case $arg in
  1238. *[\[\~\#\^\&\*\(\)\{\}\|\;\<\>\?\'\ \ ]*|*]*|"")
  1239. arg="\"$arg\""
  1240. ;;
  1241. esac
  1242. ;;
  1243. *.$objext)
  1244. # A standard object.
  1245. objs="$objs $arg"
  1246. ;;
  1247. *.lo)
  1248. # A libtool-controlled object.
  1249. # Check to see that this really is a libtool object.
  1250. if (sed -e '2q' $arg | egrep "^# Generated by .*$PACKAGE") >/dev/null 2>&1; then
  1251. pic_object=
  1252. non_pic_object=
  1253. # Read the .lo file
  1254. # If there is no directory component, then add one.
  1255. case $arg in
  1256. */* | *\\*) . $arg ;;
  1257. *) . ./$arg ;;
  1258. esac
  1259. if test -z "$pic_object" || \
  1260. test -z "$non_pic_object" ||
  1261. test "$pic_object" = none && \
  1262. test "$non_pic_object" = none; then
  1263. $echo "$modename: cannot find name of object for \`$arg'" 1>&2
  1264. exit 1
  1265. fi
  1266. # Extract subdirectory from the argument.
  1267. xdir=`$echo "X$arg" | $Xsed -e 's%/[^/]*$%%'`
  1268. if test "X$xdir" = "X$arg"; then
  1269. xdir=
  1270. else
  1271. xdir="$xdir/"
  1272. fi
  1273. if test "$pic_object" != none; then
  1274. # Prepend the subdirectory the object is found in.
  1275. pic_object="$xdir$pic_object"
  1276. if test "$prev" = dlfiles; then
  1277. if test "$build_libtool_libs" = yes && test "$dlopen_support" = yes; then
  1278. dlfiles="$dlfiles $pic_object"
  1279. prev=
  1280. continue
  1281. else
  1282. # If libtool objects are unsupported, then we need to preload.
  1283. prev=dlprefiles
  1284. fi
  1285. fi
  1286. # CHECK ME: I think I busted this. -Ossama
  1287. if test "$prev" = dlprefiles; then
  1288. # Preload the old-style object.
  1289. dlprefiles="$dlprefiles $pic_object"
  1290. prev=
  1291. fi
  1292. # A PIC object.
  1293. libobjs="$libobjs $pic_object"
  1294. arg="$pic_object"
  1295. fi
  1296. # Non-PIC object.
  1297. if test "$non_pic_object" != none; then
  1298. # Prepend the subdirectory the object is found in.
  1299. non_pic_object="$xdir$non_pic_object"
  1300. # A standard non-PIC object
  1301. non_pic_objects="$non_pic_objects $non_pic_object"
  1302. if test -z "$pic_object" || test "$pic_object" = none ; then
  1303. arg="$non_pic_object"
  1304. fi
  1305. fi
  1306. else
  1307. # Only an error if not doing a dry-run.
  1308. if test -z "$run"; then
  1309. $echo "$modename: \`$arg' is not a valid libtool object" 1>&2
  1310. exit 1
  1311. else
  1312. # Dry-run case.
  1313. # Extract subdirectory from the argument.
  1314. xdir=`$echo "X$arg" | $Xsed -e 's%/[^/]*$%%'`
  1315. if test "X$xdir" = "X$arg"; then
  1316. xdir=
  1317. else
  1318. xdir="$xdir/"
  1319. fi
  1320. pic_object=`$echo "X${xdir}${objdir}/${arg}" | $Xsed -e "$lo2o"`
  1321. non_pic_object=`$echo "X${xdir}${arg}" | $Xsed -e "$lo2o"`
  1322. libobjs="$libobjs $pic_object"
  1323. non_pic_objects="$non_pic_objects $non_pic_object"
  1324. fi
  1325. fi
  1326. ;;
  1327. *.$libext)
  1328. # An archive.
  1329. deplibs="$deplibs $arg"
  1330. old_deplibs="$old_deplibs $arg"
  1331. continue
  1332. ;;
  1333. *.la)
  1334. # A libtool-controlled library.
  1335. if test "$prev" = dlfiles; then
  1336. # This library was specified with -dlopen.
  1337. dlfiles="$dlfiles $arg"
  1338. prev=
  1339. elif test "$prev" = dlprefiles; then
  1340. # The library was specified with -dlpreopen.
  1341. dlprefiles="$dlprefiles $arg"
  1342. prev=
  1343. else
  1344. deplibs="$deplibs $arg"
  1345. fi
  1346. continue
  1347. ;;
  1348. # Some other compiler argument.
  1349. *)
  1350. # Unknown arguments in both finalize_command and compile_command need
  1351. # to be aesthetically quoted because they are evaled later.
  1352. arg=`$echo "X$arg" | $Xsed -e "$sed_quote_subst"`
  1353. case $arg in
  1354. *[\[\~\#\^\&\*\(\)\{\}\|\;\<\>\?\'\ \ ]*|*]*|"")
  1355. arg="\"$arg\""
  1356. ;;
  1357. esac
  1358. ;;
  1359. esac # arg
  1360. # Now actually substitute the argument into the commands.
  1361. if test -n "$arg"; then
  1362. compile_command="$compile_command $arg"
  1363. finalize_command="$finalize_command $arg"
  1364. fi
  1365. done # argument parsing loop
  1366. if test -n "$prev"; then
  1367. $echo "$modename: the \`$prevarg' option requires an argument" 1>&2
  1368. $echo "$help" 1>&2
  1369. exit 1
  1370. fi
  1371. # Infer tagged configuration to use if any are available and
  1372. # if one wasn't chosen via the "--tag" command line option.
  1373. # Only attempt this if the compiler in the base link
  1374. # command doesn't match the default compiler.
  1375. if test -n "$available_tags" && test -z "$tagname"; then
  1376. case $base_compile in
  1377. "$CC "*) ;;
  1378. # Blanks in the command may have been stripped by the calling shell,
  1379. # but not from the CC environment variable when ltconfig was run.
  1380. "`$echo $CC` "*) ;;
  1381. *)
  1382. for z in $available_tags; do
  1383. if grep "^# ### BEGIN LIBTOOL TAG CONFIG: $z$" < "$0" > /dev/null; then
  1384. # Evaluate the configuration.
  1385. eval "`sed -n -e '/^# ### BEGIN LIBTOOL TAG CONFIG: '$z'$/,/^# ### END LIBTOOL TAG CONFIG: '$z'$/p' < $0`"
  1386. case $base_compile in
  1387. "$CC "*)
  1388. # The compiler in $compile_command matches
  1389. # the one in the tagged configuration.
  1390. # Assume this is the tagged configuration we want.
  1391. tagname=$z
  1392. break
  1393. ;;
  1394. "`$echo $CC` "*)
  1395. tagname=$z
  1396. break
  1397. ;;
  1398. esac
  1399. fi
  1400. done
  1401. # If $tagname still isn't set, then no tagged configuration
  1402. # was found and let the user know that the "--tag" command
  1403. # line option must be used.
  1404. if test -z "$tagname"; then
  1405. echo "$modename: unable to infer tagged configuration"
  1406. echo "$modename: specify a tag with \`--tag'" 1>&2
  1407. exit 1
  1408. # else
  1409. # echo "$modename: using $tagname tagged configuration"
  1410. fi
  1411. ;;
  1412. esac
  1413. fi
  1414. if test "$export_dynamic" = yes && test -n "$export_dynamic_flag_spec"; then
  1415. eval arg=\"$export_dynamic_flag_spec\"
  1416. compile_command="$compile_command $arg"
  1417. finalize_command="$finalize_command $arg"
  1418. fi
  1419. oldlibs=
  1420. # calculate the name of the file, without its directory
  1421. outputname=`$echo "X$output" | $Xsed -e 's%^.*/%%'`
  1422. libobjs_save="$libobjs"
  1423. if test -n "$shlibpath_var"; then
  1424. # get the directories listed in $shlibpath_var
  1425. eval shlib_search_path=\`\$echo \"X\${$shlibpath_var}\" \| \$Xsed -e \'s/:/ /g\'\`
  1426. else
  1427. shlib_search_path=
  1428. fi
  1429. eval sys_lib_search_path=\"$sys_lib_search_path_spec\"
  1430. eval sys_lib_dlsearch_path=\"$sys_lib_dlsearch_path_spec\"
  1431. output_objdir=`$echo "X$output" | $Xsed -e 's%/[^/]*$%%'`
  1432. if test "X$output_objdir" = "X$output"; then
  1433. output_objdir="$objdir"
  1434. else
  1435. output_objdir="$output_objdir/$objdir"
  1436. fi
  1437. # Create the object directory.
  1438. if test ! -d $output_objdir; then
  1439. $show "$mkdir $output_objdir"
  1440. $run $mkdir $output_objdir
  1441. status=$?
  1442. if test $status -ne 0 && test ! -d $output_objdir; then
  1443. exit $status
  1444. fi
  1445. fi
  1446. # Determine the type of output
  1447. case $output in
  1448. "")
  1449. $echo "$modename: you must specify an output file" 1>&2
  1450. $echo "$help" 1>&2
  1451. exit 1
  1452. ;;
  1453. *.$libext) linkmode=oldlib ;;
  1454. *.lo | *.$objext) linkmode=obj ;;
  1455. *.la) linkmode=lib ;;
  1456. *) linkmode=prog ;; # Anything else should be a program.
  1457. esac
  1458. specialdeplibs=
  1459. libs=
  1460. # Find all interdependent deplibs by searching for libraries
  1461. # that are linked more than once (e.g. -la -lb -la)
  1462. for deplib in $deplibs; do
  1463. case "$libs " in
  1464. *" $deplib "*) specialdeplibs="$specialdeplibs $deplib" ;;
  1465. esac
  1466. libs="$libs $deplib"
  1467. done
  1468. if test $linkmode = lib; then
  1469. libs="$predeps $libs $compiler_lib_search_path $postdeps"
  1470. # Compute libraries that are listed more than once in $predeps
  1471. # $postdeps and mark them as special (i.e., whose duplicates are
  1472. # not to be eliminated).
  1473. pre_post_deps=
  1474. for pre_post_dep in $predeps $postdeps; do
  1475. case "$pre_post_deps " in
  1476. *" $pre_post_dep "*) specialdeplibs="$specialdeplibs $pre_post_deps" ;;
  1477. esac
  1478. pre_post_deps="$pre_post_deps $pre_post_dep"
  1479. done
  1480. pre_post_deps=
  1481. fi
  1482. deplibs=
  1483. newdependency_libs=
  1484. newlib_search_path=
  1485. need_relink=no # whether we're linking any uninstalled libtool libraries
  1486. notinst_deplibs= # not-installed libtool libraries
  1487. notinst_path= # paths that contain not-installed libtool libraries
  1488. case $linkmode in
  1489. lib)
  1490. passes="conv link"
  1491. for file in $dlfiles $dlprefiles; do
  1492. case $file in
  1493. *.la) ;;
  1494. *)
  1495. $echo "$modename: libraries can \`-dlopen' only libtool libraries: $file" 1>&2
  1496. exit 1
  1497. ;;
  1498. esac
  1499. done
  1500. ;;
  1501. prog)
  1502. compile_deplibs=
  1503. finalize_deplibs=
  1504. alldeplibs=no
  1505. newdlfiles=
  1506. newdlprefiles=
  1507. passes="conv scan dlopen dlpreopen link"
  1508. ;;
  1509. *) passes="conv"
  1510. ;;
  1511. esac
  1512. for pass in $passes; do
  1513. if test "$linkmode,$pass" = "lib,link" ||
  1514. test "$linkmode,$pass" = "prog,scan"; then
  1515. libs="$deplibs"
  1516. deplibs=
  1517. fi
  1518. if test $linkmode = prog; then
  1519. case $pass in
  1520. dlopen) libs="$dlfiles" ;;
  1521. dlpreopen) libs="$dlprefiles" ;;
  1522. link) libs="$deplibs %DEPLIBS% $dependency_libs" ;;
  1523. esac
  1524. fi
  1525. if test $pass = dlopen; then
  1526. # Collect dlpreopened libraries
  1527. save_deplibs="$deplibs"
  1528. deplibs=
  1529. fi
  1530. for deplib in $libs; do
  1531. lib=
  1532. found=no
  1533. case $deplib in
  1534. -l*)
  1535. if test $linkmode != lib && test $linkmode != prog; then
  1536. $echo "$modename: warning: \`-l' is ignored for archives/objects" 1>&2
  1537. continue
  1538. fi
  1539. if test $pass = conv; then
  1540. deplibs="$deplib $deplibs"
  1541. continue
  1542. fi
  1543. name=`$echo "X$deplib" | $Xsed -e 's/^-l//'`
  1544. for searchdir in $newlib_search_path $lib_search_path $sys_lib_search_path $shlib_search_path; do
  1545. # Search the libtool library
  1546. lib="$searchdir/lib${name}.la"
  1547. if test -f "$lib"; then
  1548. found=yes
  1549. break
  1550. fi
  1551. done
  1552. if test "$found" != yes; then
  1553. # deplib doesn't seem to be a libtool library
  1554. if test "$linkmode,$pass" = "prog,link"; then
  1555. compile_deplibs="$deplib $compile_deplibs"
  1556. finalize_deplibs="$deplib $finalize_deplibs"
  1557. else
  1558. deplibs="$deplib $deplibs"
  1559. test $linkmode = lib && newdependency_libs="$deplib $newdependency_libs"
  1560. fi
  1561. continue
  1562. fi
  1563. ;; # -l
  1564. -L*)
  1565. case $linkmode in
  1566. lib)
  1567. deplibs="$deplib $deplibs"
  1568. test $pass = conv && continue
  1569. newdependency_libs="$deplib $newdependency_libs"
  1570. newlib_search_path="$newlib_search_path "`$echo "X$deplib" | $Xsed -e 's/^-L//'`
  1571. ;;
  1572. prog)
  1573. if test $pass = conv; then
  1574. deplibs="$deplib $deplibs"
  1575. continue
  1576. fi
  1577. if test $pass = scan; then
  1578. deplibs="$deplib $deplibs"
  1579. newlib_search_path="$newlib_search_path "`$echo "X$deplib" | $Xsed -e 's/^-L//'`
  1580. else
  1581. compile_deplibs="$deplib $compile_deplibs"
  1582. finalize_deplibs="$deplib $finalize_deplibs"
  1583. fi
  1584. ;;
  1585. *)
  1586. $echo "$modename: warning: \`-L' is ignored for archives/objects" 1>&2
  1587. ;;
  1588. esac # linkmode
  1589. continue
  1590. ;; # -L
  1591. -R*)
  1592. if test $pass = link; then
  1593. dir=`$echo "X$deplib" | $Xsed -e 's/^-R//'`
  1594. # Make sure the xrpath contains only unique directories.
  1595. case "$xrpath " in
  1596. *" $dir "*) ;;
  1597. *) xrpath="$xrpath $dir" ;;
  1598. esac
  1599. fi
  1600. deplibs="$deplib $deplibs"
  1601. continue
  1602. ;;
  1603. *.la) lib="$deplib" ;;
  1604. *.$libext)
  1605. if test $pass = conv; then
  1606. deplibs="$deplib $deplibs"
  1607. continue
  1608. fi
  1609. case $linkmode in
  1610. lib)
  1611. if test "$deplibs_check_method" != pass_all; then
  1612. echo
  1613. echo "*** Warning: This library needs some functionality provided by $deplib."
  1614. echo "*** I have the capability to make that library automatically link in when"
  1615. echo "*** you link to this library. But I can only do this if you have a"
  1616. echo "*** shared version of the library, which you do not appear to have."
  1617. else
  1618. echo
  1619. echo "*** Warning: Linking the shared library $output against the"
  1620. echo "*** static library $deplib is not portable!"
  1621. deplibs="$deplib $deplibs"
  1622. fi
  1623. continue
  1624. ;;
  1625. prog)
  1626. if test $pass != link; then
  1627. deplibs="$deplib $deplibs"
  1628. else
  1629. compile_deplibs="$deplib $compile_deplibs"
  1630. finalize_deplibs="$deplib $finalize_deplibs"
  1631. fi
  1632. continue
  1633. ;;
  1634. esac # linkmode
  1635. ;; # *.$libext
  1636. *.lo | *.$objext)
  1637. if test $pass = conv; then
  1638. deplibs="$deplib $deplibs"
  1639. elif test $linkmode = prog; then
  1640. if test $pass = dlpreopen || test "$dlopen_support" != yes || test "$build_libtool_libs" = no; then
  1641. # If there is no dlopen support or we're linking statically,
  1642. # we need to preload.
  1643. newdlprefiles="$newdlprefiles $deplib"
  1644. compile_deplibs="$deplib $compile_deplibs"
  1645. finalize_deplibs="$deplib $finalize_deplibs"
  1646. else
  1647. newdlfiles="$newdlfiles $deplib"
  1648. fi
  1649. fi
  1650. continue
  1651. ;;
  1652. %DEPLIBS%)
  1653. alldeplibs=yes
  1654. continue
  1655. ;;
  1656. esac # case $deplib
  1657. if test $found = yes || test -f "$lib"; then :
  1658. else
  1659. $echo "$modename: cannot find the library \`$lib'" 1>&2
  1660. exit 1
  1661. fi
  1662. # Check to see that this really is a libtool archive.
  1663. if (sed -e '2q' $lib | egrep "^# Generated by .*$PACKAGE") >/dev/null 2>&1; then :
  1664. else
  1665. $echo "$modename: \`$lib' is not a valid libtool archive" 1>&2
  1666. exit 1
  1667. fi
  1668. ladir=`$echo "X$lib" | $Xsed -e 's%/[^/]*$%%'`
  1669. test "X$ladir" = "X$lib" && ladir="."
  1670. dlname=
  1671. dlopen=
  1672. dlpreopen=
  1673. libdir=
  1674. library_names=
  1675. old_library=
  1676. # If the library was installed with an old release of libtool,
  1677. # it will not redefine variable installed.
  1678. installed=yes
  1679. # Read the .la file
  1680. case $lib in
  1681. */* | *\\*) . $lib ;;
  1682. *) . ./$lib ;;
  1683. esac
  1684. if test "$linkmode,$pass" = "lib,link" ||
  1685. test "$linkmode,$pass" = "prog,scan" ||
  1686. { test $linkmode != prog && test $linkmode != lib; }; then
  1687. test -n "$dlopen" && dlfiles="$dlfiles $dlopen"
  1688. test -n "$dlpreopen" && dlprefiles="$dlprefiles $dlpreopen"
  1689. fi
  1690. if test $pass = conv; then
  1691. # Only check for convenience libraries
  1692. deplibs="$lib $deplibs"
  1693. if test -z "$libdir"; then
  1694. if test -z "$old_library"; then
  1695. $echo "$modename: cannot find name of link library for \`$lib'" 1>&2
  1696. exit 1
  1697. fi
  1698. # It is a libtool convenience library, so add in its objects.
  1699. convenience="$convenience $ladir/$objdir/$old_library"
  1700. old_convenience="$old_convenience $ladir/$objdir/$old_library"
  1701. tmp_libs=
  1702. for deplib in $dependency_libs; do
  1703. deplibs="$deplib $deplibs"
  1704. case "$tmp_libs " in
  1705. *" $deplib "*) specialdeplibs="$specialdeplibs $deplib" ;;
  1706. esac
  1707. tmp_libs="$tmp_libs $deplib"
  1708. done
  1709. elif test $linkmode != prog && test $linkmode != lib; then
  1710. $echo "$modename: \`$lib' is not a convenience library" 1>&2
  1711. exit 1
  1712. fi
  1713. continue
  1714. fi # $pass = conv
  1715. # Get the name of the library we link against.
  1716. linklib=
  1717. for l in $old_library $library_names; do
  1718. linklib="$l"
  1719. done
  1720. if test -z "$linklib"; then
  1721. $echo "$modename: cannot find name of link library for \`$lib'" 1>&2
  1722. exit 1
  1723. fi
  1724. # This library was specified with -dlopen.
  1725. if test $pass = dlopen; then
  1726. if test -z "$libdir"; then
  1727. $echo "$modename: cannot -dlopen a convenience library: \`$lib'" 1>&2
  1728. exit 1
  1729. fi
  1730. if test -z "$dlname" || test "$dlopen_support" != yes || test "$build_libtool_libs" = no; then
  1731. # If there is no dlname, no dlopen support or we're linking
  1732. # statically, we need to preload. We also need to preload any
  1733. # dependent libraries so libltdl's deplib preloader doesn't
  1734. # bomb out in the load deplibs phase.
  1735. dlprefiles="$dlprefiles $lib $dependency_libs"
  1736. else
  1737. newdlfiles="$newdlfiles $lib"
  1738. fi
  1739. continue
  1740. fi # $pass = dlopen
  1741. # We need an absolute path.
  1742. case $ladir in
  1743. [\\/]* | [A-Za-z]:[\\/]*) abs_ladir="$ladir" ;;
  1744. *)
  1745. abs_ladir=`cd "$ladir" && pwd`
  1746. if test -z "$abs_ladir"; then
  1747. $echo "$modename: warning: cannot determine absolute directory name of \`$ladir'" 1>&2
  1748. $echo "$modename: passing it literally to the linker, although it might fail" 1>&2
  1749. abs_ladir="$ladir"
  1750. fi
  1751. ;;
  1752. esac
  1753. laname=`$echo "X$lib" | $Xsed -e 's%^.*/%%'`
  1754. # Find the relevant object directory and library name.
  1755. if test "X$installed" = Xyes; then
  1756. if test ! -f "$libdir/$linklib" && test -f "$abs_ladir/$linklib"; then
  1757. $echo "$modename: warning: library \`$lib' was moved." 1>&2
  1758. dir="$ladir"
  1759. absdir="$abs_ladir"
  1760. libdir="$abs_ladir"
  1761. else
  1762. dir="$libdir"
  1763. absdir="$libdir"
  1764. fi
  1765. else
  1766. dir="$ladir/$objdir"
  1767. absdir="$abs_ladir/$objdir"
  1768. # Remove this search path later
  1769. notinst_path="$notinst_path $abs_ladir"
  1770. fi # $installed = yes
  1771. name=`$echo "X$laname" | $Xsed -e 's/\.la$//' -e 's/^lib//'`
  1772. # This library was specified with -dlpreopen.
  1773. if test $pass = dlpreopen; then
  1774. if test -z "$libdir"; then
  1775. $echo "$modename: cannot -dlpreopen a convenience library: \`$lib'" 1>&2
  1776. exit 1
  1777. fi
  1778. # Prefer using a static library (so that no silly _DYNAMIC symbols
  1779. # are required to link).
  1780. if test -n "$old_library"; then
  1781. newdlprefiles="$newdlprefiles $dir/$old_library"
  1782. # Otherwise, use the dlname, so that lt_dlopen finds it.
  1783. elif test -n "$dlname"; then
  1784. newdlprefiles="$newdlprefiles $dir/$dlname"
  1785. else
  1786. newdlprefiles="$newdlprefiles $dir/$linklib"
  1787. fi
  1788. fi # $pass = dlpreopen
  1789. if test -z "$libdir"; then
  1790. # Link the convenience library
  1791. if test $linkmode = lib; then
  1792. deplibs="$dir/$old_library $deplibs"
  1793. elif test "$linkmode,$pass" = "prog,link"; then
  1794. compile_deplibs="$dir/$old_library $compile_deplibs"
  1795. finalize_deplibs="$dir/$old_library $finalize_deplibs"
  1796. else
  1797. deplibs="$lib $deplibs" # used for prog,scan pass
  1798. fi
  1799. continue
  1800. fi
  1801. if test $linkmode = prog && test $pass != link; then
  1802. newlib_search_path="$newlib_search_path $ladir"
  1803. deplibs="$lib $deplibs"
  1804. linkalldeplibs=no
  1805. if test "$link_all_deplibs" != no || test -z "$library_names" ||
  1806. test "$build_libtool_libs" = no; then
  1807. linkalldeplibs=yes
  1808. fi
  1809. tmp_libs=
  1810. for deplib in $dependency_libs; do
  1811. case $deplib in
  1812. -L*) newlib_search_path="$newlib_search_path "`$echo "X$deplib" | $Xsed -e 's/^-L//'`;; ### testsuite: skip nested quoting test
  1813. esac
  1814. # Need to link against all dependency_libs?
  1815. if test $linkalldeplibs = yes; then
  1816. deplibs="$deplib $deplibs"
  1817. else
  1818. # Need to hardcode shared library paths
  1819. # or/and link against static libraries
  1820. newdependency_libs="$deplib $newdependency_libs"
  1821. fi
  1822. case "$tmp_libs " in
  1823. *" $deplib "*) specialdeplibs="$specialdeplibs $deplib" ;;
  1824. esac
  1825. tmp_libs="$tmp_libs $deplib"
  1826. done # for deplib
  1827. continue
  1828. fi # $linkmode = prog...
  1829. if test "$linkmode,$pass" = "prog,link"; then
  1830. if test -n "$library_names" &&
  1831. { test "$prefer_static_libs" = no || test -z "$old_library"; }; then
  1832. # We need to hardcode the library path
  1833. if test -n "$shlibpath_var"; then
  1834. # Make sure the rpath contains only unique directories.
  1835. case "$temp_rpath " in
  1836. *" $dir "*) ;;
  1837. *" $absdir "*) ;;
  1838. *) temp_rpath="$temp_rpath $dir" ;;
  1839. esac
  1840. fi
  1841. # Hardcode the library path.
  1842. # Skip directories that are in the system default run-time
  1843. # search path.
  1844. case " $sys_lib_dlsearch_path " in
  1845. *" $absdir "*) ;;
  1846. *)
  1847. case "$compile_rpath " in
  1848. *" $absdir "*) ;;
  1849. *) compile_rpath="$compile_rpath $absdir"
  1850. esac
  1851. ;;
  1852. esac
  1853. case " $sys_lib_dlsearch_path " in
  1854. *" $libdir "*) ;;
  1855. *)
  1856. case "$finalize_rpath " in
  1857. *" $libdir "*) ;;
  1858. *) finalize_rpath="$finalize_rpath $libdir"
  1859. esac
  1860. ;;
  1861. esac
  1862. fi # $linkmode,$pass = prog,link...
  1863. if test "$alldeplibs" = yes &&
  1864. { test "$deplibs_check_method" = pass_all ||
  1865. { test "$build_libtool_libs" = yes &&
  1866. test -n "$library_names"; }; }; then
  1867. # We only need to search for static libraries
  1868. continue
  1869. fi
  1870. fi
  1871. link_static=no # Whether the deplib will be linked statically
  1872. if test -n "$library_names" &&
  1873. { test "$prefer_static_libs" = no || test -z "$old_library"; }; then
  1874. if test "$installed" = no; then
  1875. notinst_deplibs="$notinst_deplibs $lib"
  1876. need_relink=yes
  1877. fi
  1878. # This is a shared library
  1879. if test $linkmode = lib &&
  1880. test $hardcode_into_libs = yes; then
  1881. # Hardcode the library path.
  1882. # Skip directories that are in the system default run-time
  1883. # search path.
  1884. case " $sys_lib_dlsearch_path " in
  1885. *" $absdir "*) ;;
  1886. *)
  1887. case "$compile_rpath " in
  1888. *" $absdir "*) ;;
  1889. *) compile_rpath="$compile_rpath $absdir"
  1890. esac
  1891. ;;
  1892. esac
  1893. case " $sys_lib_dlsearch_path " in
  1894. *" $libdir "*) ;;
  1895. *)
  1896. case "$finalize_rpath " in
  1897. *" $libdir "*) ;;
  1898. *) finalize_rpath="$finalize_rpath $libdir"
  1899. esac
  1900. ;;
  1901. esac
  1902. fi
  1903. if test -n "$old_archive_from_expsyms_cmds"; then
  1904. # figure out the soname
  1905. set dummy $library_names
  1906. realname="$2"
  1907. shift; shift
  1908. libname=`eval \\$echo \"$libname_spec\"`
  1909. # use dlname if we got it. it's perfectly good, no?
  1910. if test -n "$dlname"; then
  1911. soname="$dlname"
  1912. elif test -n "$soname_spec"; then
  1913. # bleh windows
  1914. case $host in
  1915. *cygwin*)
  1916. major=`expr $current - $age`
  1917. versuffix="-$major"
  1918. ;;
  1919. esac
  1920. eval soname=\"$soname_spec\"
  1921. else
  1922. soname="$realname"
  1923. fi
  1924. # Make a new name for the extract_expsyms_cmds to use
  1925. soroot="$soname"
  1926. soname=`echo $soroot | sed -e 's/^.*\///'`
  1927. newlib="libimp-`echo $soname | sed 's/^lib//;s/\.dll$//'`.a"
  1928. # If the library has no export list, then create one now
  1929. if test -f "$output_objdir/$soname-def"; then :
  1930. else
  1931. $show "extracting exported symbol list from \`$soname'"
  1932. IFS="${IFS= }"; save_ifs="$IFS"; IFS='~'
  1933. eval cmds=\"$extract_expsyms_cmds\"
  1934. for cmd in $cmds; do
  1935. IFS="$save_ifs"
  1936. $show "$cmd"
  1937. $run eval "$cmd" || exit $?
  1938. done
  1939. IFS="$save_ifs"
  1940. fi
  1941. # Create $newlib
  1942. if test -f "$output_objdir/$newlib"; then :; else
  1943. $show "generating import library for \`$soname'"
  1944. IFS="${IFS= }"; save_ifs="$IFS"; IFS='~'
  1945. eval cmds=\"$old_archive_from_expsyms_cmds\"
  1946. for cmd in $cmds; do
  1947. IFS="$save_ifs"
  1948. $show "$cmd"
  1949. $run eval "$cmd" || exit $?
  1950. done
  1951. IFS="$save_ifs"
  1952. fi
  1953. # make sure the library variables are pointing to the new library
  1954. dir=$output_objdir
  1955. linklib=$newlib
  1956. fi # test -n $old_archive_from_expsyms_cmds
  1957. if test $linkmode = prog || test "$mode" != relink; then
  1958. add_shlibpath=
  1959. add_dir=
  1960. add=
  1961. lib_linked=yes
  1962. case $hardcode_action in
  1963. immediate | unsupported)
  1964. if test "$hardcode_direct" = no; then
  1965. add="$dir/$linklib"
  1966. elif test "$hardcode_minus_L" = no; then
  1967. case $host in
  1968. *-*-sunos*) add_shlibpath="$dir" ;;
  1969. esac
  1970. add_dir="-L$dir"
  1971. add="-l$name"
  1972. elif test "$hardcode_shlibpath_var" = no; then
  1973. add_shlibpath="$dir"
  1974. add="-l$name"
  1975. else
  1976. lib_linked=no
  1977. fi
  1978. ;;
  1979. relink)
  1980. if test "$hardcode_direct" = yes; then
  1981. add="$dir/$linklib"
  1982. elif test "$hardcode_minus_L" = yes; then
  1983. add_dir="-L$dir"
  1984. add="-l$name"
  1985. elif test "$hardcode_shlibpath_var" = yes; then
  1986. add_shlibpath="$dir"
  1987. add="-l$name"
  1988. else
  1989. lib_linked=no
  1990. fi
  1991. ;;
  1992. *) lib_linked=no ;;
  1993. esac
  1994. if test "$lib_linked" != yes; then
  1995. $echo "$modename: configuration error: unsupported hardcode properties"
  1996. exit 1
  1997. fi
  1998. if test -n "$add_shlibpath"; then
  1999. case :$compile_shlibpath: in
  2000. *":$add_shlibpath:"*) ;;
  2001. *) compile_shlibpath="$compile_shlibpath$add_shlibpath:" ;;
  2002. esac
  2003. fi
  2004. if test $linkmode = prog; then
  2005. test -n "$add_dir" && compile_deplibs="$add_dir $compile_deplibs"
  2006. test -n "$add" && compile_deplibs="$add $compile_deplibs"
  2007. else
  2008. test -n "$add_dir" && deplibs="$add_dir $deplibs"
  2009. test -n "$add" && deplibs="$add $deplibs"
  2010. if test "$hardcode_direct" != yes && \
  2011. test "$hardcode_minus_L" != yes && \
  2012. test "$hardcode_shlibpath_var" = yes; then
  2013. case :$finalize_shlibpath: in
  2014. *":$libdir:"*) ;;
  2015. *) finalize_shlibpath="$finalize_shlibpath$libdir:" ;;
  2016. esac
  2017. fi
  2018. fi
  2019. fi
  2020. if test $linkmode = prog || test "$mode" = relink; then
  2021. add_shlibpath=
  2022. add_dir=
  2023. add=
  2024. # Finalize command for both is simple: just hardcode it.
  2025. if test "$hardcode_direct" = yes; then
  2026. add="$libdir/$linklib"
  2027. elif test "$hardcode_minus_L" = yes; then
  2028. add_dir="-L$libdir"
  2029. add="-l$name"
  2030. elif test "$hardcode_shlibpath_var" = yes; then
  2031. case :$finalize_shlibpath: in
  2032. *":$libdir:"*) ;;
  2033. *) finalize_shlibpath="$finalize_shlibpath$libdir:" ;;
  2034. esac
  2035. add="-l$name"
  2036. else
  2037. # We cannot seem to hardcode it, guess we'll fake it.
  2038. add_dir="-L$libdir"
  2039. add="-l$name"
  2040. fi
  2041. if test $linkmode = prog; then
  2042. test -n "$add_dir" && finalize_deplibs="$add_dir $finalize_deplibs"
  2043. test -n "$add" && finalize_deplibs="$add $finalize_deplibs"
  2044. else
  2045. test -n "$add_dir" && deplibs="$add_dir $deplibs"
  2046. test -n "$add" && deplibs="$add $deplibs"
  2047. fi
  2048. fi
  2049. elif test $linkmode = prog; then
  2050. # Here we assume that one of hardcode_direct or hardcode_minus_L
  2051. # is not unsupported. This is valid on all known static and
  2052. # shared platforms.
  2053. if test "$hardcode_direct" != unsupported; then
  2054. test -n "$old_library" && linklib="$old_library"
  2055. compile_deplibs="$dir/$linklib $compile_deplibs"
  2056. finalize_deplibs="$dir/$linklib $finalize_deplibs"
  2057. else
  2058. compile_deplibs="-l$name -L$dir $compile_deplibs"
  2059. finalize_deplibs="-l$name -L$dir $finalize_deplibs"
  2060. fi
  2061. elif test "$build_libtool_libs" = yes; then
  2062. # Not a shared library
  2063. if test "$deplibs_check_method" != pass_all; then
  2064. # We're trying link a shared library against a static one
  2065. # but the system doesn't support it.
  2066. # Just print a warning and add the library to dependency_libs so
  2067. # that the program can be linked against the static library.
  2068. echo
  2069. echo "*** Warning: This library needs some functionality provided by $lib."
  2070. echo "*** I have the capability to make that library automatically link in when"
  2071. echo "*** you link to this library. But I can only do this if you have a"
  2072. echo "*** shared version of the library, which you do not appear to have."
  2073. if test "$module" = yes; then
  2074. echo "*** Therefore, libtool will create a static module, that should work "
  2075. echo "*** as long as the dlopening application is linked with the -dlopen flag."
  2076. if test -z "$global_symbol_pipe"; then
  2077. echo
  2078. echo "*** However, this would only work if libtool was able to extract symbol"
  2079. echo "*** lists from a program, using \`nm' or equivalent, but libtool could"
  2080. echo "*** not find such a program. So, this module is probably useless."
  2081. echo "*** \`nm' from GNU binutils and a full rebuild may help."
  2082. fi
  2083. if test "$build_old_libs" = no; then
  2084. build_libtool_libs=module
  2085. build_old_libs=yes
  2086. else
  2087. build_libtool_libs=no
  2088. fi
  2089. fi
  2090. else
  2091. convenience="$convenience $dir/$old_library"
  2092. old_convenience="$old_convenience $dir/$old_library"
  2093. deplibs="$dir/$old_library $deplibs"
  2094. link_static=yes
  2095. fi
  2096. fi # link shared/static library?
  2097. if test $linkmode = lib; then
  2098. if test -n "$dependency_libs" &&
  2099. { test $hardcode_into_libs != yes || test $build_old_libs = yes ||
  2100. test $link_static = yes; }; then
  2101. # Extract -R from dependency_libs
  2102. temp_deplibs=
  2103. for libdir in $dependency_libs; do
  2104. case $libdir in
  2105. -R*) temp_xrpath=`$echo "X$libdir" | $Xsed -e 's/^-R//'`
  2106. case " $xrpath " in
  2107. *" $temp_xrpath "*) ;;
  2108. *) xrpath="$xrpath $temp_xrpath";;
  2109. esac;;
  2110. *) temp_deplibs="$temp_deplibs $libdir";;
  2111. esac
  2112. done
  2113. dependency_libs="$temp_deplibs"
  2114. fi
  2115. newlib_search_path="$newlib_search_path $absdir"
  2116. # Link against this library
  2117. test "$link_static" = no && newdependency_libs="$abs_ladir/$laname $newdependency_libs"
  2118. # ... and its dependency_libs
  2119. tmp_libs=
  2120. for deplib in $dependency_libs; do
  2121. newdependency_libs="$deplib $newdependency_libs"
  2122. case "$tmp_libs " in
  2123. *" $deplib "*) specialdeplibs="$specialdeplibs $deplib" ;;
  2124. esac
  2125. tmp_libs="$tmp_libs $deplib"
  2126. done
  2127. if test $link_all_deplibs != no; then
  2128. # Add the search paths of all dependency libraries
  2129. for deplib in $dependency_libs; do
  2130. case $deplib in
  2131. -L*) path="$deplib" ;;
  2132. *.la)
  2133. dir=`$echo "X$deplib" | $Xsed -e 's%/[^/]*$%%'`
  2134. test "X$dir" = "X$deplib" && dir="."
  2135. # We need an absolute path.
  2136. case $dir in
  2137. [\\/]* | [A-Za-z]:[\\/]*) absdir="$dir" ;;
  2138. *)
  2139. absdir=`cd "$dir" && pwd`
  2140. if test -z "$absdir"; then
  2141. $echo "$modename: warning: cannot determine absolute directory name of \`$dir'" 1>&2
  2142. absdir="$dir"
  2143. fi
  2144. ;;
  2145. esac
  2146. if grep "^installed=no" $deplib > /dev/null; then
  2147. path="-L$absdir/$objdir"
  2148. else
  2149. eval libdir=`sed -n -e 's/^libdir=\(.*\)$/\1/p' $deplib`
  2150. if test -z "$libdir"; then
  2151. $echo "$modename: \`$deplib' is not a valid libtool archive" 1>&2
  2152. exit 1
  2153. fi
  2154. if test "$absdir" != "$libdir"; then
  2155. $echo "$modename: warning: \`$deplib' seems to be moved" 1>&2
  2156. fi
  2157. path="-L$absdir"
  2158. fi
  2159. ;;
  2160. *) continue ;;
  2161. esac
  2162. case " $deplibs " in
  2163. *" $path "*) ;;
  2164. *) deplibs="$deplibs $path" ;;
  2165. esac
  2166. done
  2167. fi # link_all_deplibs != no
  2168. fi # linkmode = lib
  2169. done # for deplib in $libs
  2170. dependency_libs="$newdependency_libs"
  2171. if test $pass = dlpreopen; then
  2172. # Link the dlpreopened libraries before other libraries
  2173. for deplib in $save_deplibs; do
  2174. deplibs="$deplib $deplibs"
  2175. done
  2176. fi
  2177. if test $pass != dlopen; then
  2178. if test $pass != conv; then
  2179. # Make sure lib_search_path contains only unique directories.
  2180. lib_search_path=
  2181. for dir in $newlib_search_path; do
  2182. case "$lib_search_path " in
  2183. *" $dir "*) ;;
  2184. *) lib_search_path="$lib_search_path $dir" ;;
  2185. esac
  2186. done
  2187. newlib_search_path=
  2188. fi
  2189. if test "$linkmode,$pass" != "prog,link"; then
  2190. vars="deplibs"
  2191. else
  2192. vars="compile_deplibs finalize_deplibs"
  2193. fi
  2194. for var in $vars dependency_libs; do
  2195. # Add libraries to $var in reverse order
  2196. eval tmp_libs=\"\$$var\"
  2197. new_libs=
  2198. for deplib in $tmp_libs; do
  2199. # FIXME: Pedantically, this is the right thing to do, so
  2200. # that some nasty dependency loop isn't accidentally
  2201. # broken:
  2202. #new_libs="$deplib $new_libs"
  2203. # Pragmatically, this seems to cause very few problems in
  2204. # practice:
  2205. case $deplib in
  2206. -L*) new_libs="$deplib $new_libs" ;;
  2207. *)
  2208. # And here is the reason: when a library appears more
  2209. # than once as an explicit dependence of a library, or
  2210. # is implicitly linked in more than once by the
  2211. # compiler, it is considered special, and multiple
  2212. # occurrences thereof are not removed. Compare this
  2213. # with having the same library being listed as a
  2214. # dependency of multiple other libraries: in this case,
  2215. # we know (pedantically, we assume) the library does not
  2216. # need to be listed more than once, so we keep only the
  2217. # last copy. This is not always right, but it is rare
  2218. # enough that we require users that really mean to play
  2219. # such unportable linking tricks to link the library
  2220. # using -Wl,-lname, so that libtool does not consider it
  2221. # for duplicate removal.
  2222. case " $specialdeplibs " in
  2223. *" $deplib "*) new_libs="$deplib $new_libs" ;;
  2224. *)
  2225. case " $new_libs " in
  2226. *" $deplib "*) ;;
  2227. *) new_libs="$deplib $new_libs" ;;
  2228. esac
  2229. ;;
  2230. esac
  2231. ;;
  2232. esac
  2233. done
  2234. tmp_libs=
  2235. for deplib in $new_libs; do
  2236. case $deplib in
  2237. -L*)
  2238. case " $tmp_libs " in
  2239. *" $deplib "*) ;;
  2240. *) tmp_libs="$tmp_libs $deplib" ;;
  2241. esac
  2242. ;;
  2243. *) tmp_libs="$tmp_libs $deplib" ;;
  2244. esac
  2245. done
  2246. eval $var=\"$tmp_libs\"
  2247. done # for var
  2248. fi
  2249. done # for pass
  2250. if test $linkmode = prog; then
  2251. dlfiles="$newdlfiles"
  2252. dlprefiles="$newdlprefiles"
  2253. fi
  2254. case $linkmode in
  2255. oldlib)
  2256. if test -n "$deplibs"; then
  2257. $echo "$modename: warning: \`-l' and \`-L' are ignored for archives" 1>&2
  2258. fi
  2259. if test -n "$dlfiles$dlprefiles" || test "$dlself" != no; then
  2260. $echo "$modename: warning: \`-dlopen' is ignored for archives" 1>&2
  2261. fi
  2262. if test -n "$rpath"; then
  2263. $echo "$modename: warning: \`-rpath' is ignored for archives" 1>&2
  2264. fi
  2265. if test -n "$xrpath"; then
  2266. $echo "$modename: warning: \`-R' is ignored for archives" 1>&2
  2267. fi
  2268. if test -n "$vinfo"; then
  2269. $echo "$modename: warning: \`-version-info' is ignored for archives" 1>&2
  2270. fi
  2271. if test -n "$release"; then
  2272. $echo "$modename: warning: \`-release' is ignored for archives" 1>&2
  2273. fi
  2274. if test -n "$export_symbols" || test -n "$export_symbols_regex"; then
  2275. $echo "$modename: warning: \`-export-symbols' is ignored for archives" 1>&2
  2276. fi
  2277. # Now set the variables for building old libraries.
  2278. build_libtool_libs=no
  2279. oldlibs="$output"
  2280. objs="$objs$old_deplibs"
  2281. ;;
  2282. lib)
  2283. # Make sure we only generate libraries of the form `libNAME.la'.
  2284. case $outputname in
  2285. lib*)
  2286. name=`$echo "X$outputname" | $Xsed -e 's/\.la$//' -e 's/^lib//'`
  2287. eval libname=\"$libname_spec\"
  2288. ;;
  2289. *)
  2290. if test "$module" = no; then
  2291. $echo "$modename: libtool library \`$output' must begin with \`lib'" 1>&2
  2292. $echo "$help" 1>&2
  2293. exit 1
  2294. fi
  2295. if test "$need_lib_prefix" != no; then
  2296. # Add the "lib" prefix for modules if required
  2297. name=`$echo "X$outputname" | $Xsed -e 's/\.la$//'`
  2298. eval libname=\"$libname_spec\"
  2299. else
  2300. libname=`$echo "X$outputname" | $Xsed -e 's/\.la$//'`
  2301. fi
  2302. ;;
  2303. esac
  2304. if test -n "$objs"; then
  2305. if test "$deplibs_check_method" != pass_all; then
  2306. $echo "$modename: cannot build libtool library \`$output' from non-libtool objects on this host:$objs" 2>&1
  2307. exit 1
  2308. else
  2309. echo
  2310. echo "*** Warning: Linking the shared library $output against the non-libtool"
  2311. echo "*** objects $objs is not portable!"
  2312. libobjs="$libobjs $objs"
  2313. fi
  2314. fi
  2315. if test "$dlself" != no; then
  2316. $echo "$modename: warning: \`-dlopen self' is ignored for libtool libraries" 1>&2
  2317. fi
  2318. set dummy $rpath
  2319. if test $# -gt 2; then
  2320. $echo "$modename: warning: ignoring multiple \`-rpath's for a libtool library" 1>&2
  2321. fi
  2322. install_libdir="$2"
  2323. oldlibs=
  2324. if test -z "$rpath"; then
  2325. if test "$build_libtool_libs" = yes; then
  2326. # Building a libtool convenience library.
  2327. # Some compilers have problems with a `.al' extension so
  2328. # convenience libraries should have the same extension an
  2329. # archive normally would.
  2330. oldlibs="$output_objdir/$libname.$libext $oldlibs"
  2331. build_libtool_libs=convenience
  2332. build_old_libs=yes
  2333. fi
  2334. if test -n "$vinfo"; then
  2335. $echo "$modename: warning: \`-version-info' is ignored for convenience libraries" 1>&2
  2336. fi
  2337. if test -n "$release"; then
  2338. $echo "$modename: warning: \`-release' is ignored for convenience libraries" 1>&2
  2339. fi
  2340. else
  2341. # Parse the version information argument.
  2342. IFS="${IFS= }"; save_ifs="$IFS"; IFS=':'
  2343. set dummy $vinfo 0 0 0
  2344. IFS="$save_ifs"
  2345. if test -n "$8"; then
  2346. $echo "$modename: too many parameters to \`-version-info'" 1>&2
  2347. $echo "$help" 1>&2
  2348. exit 1
  2349. fi
  2350. current="$2"
  2351. revision="$3"
  2352. age="$4"
  2353. # Check that each of the things are valid numbers.
  2354. case $current in
  2355. 0 | [1-9] | [1-9][0-9] | [1-9][0-9][0-9]) ;;
  2356. *)
  2357. $echo "$modename: CURRENT \`$current' is not a nonnegative integer" 1>&2
  2358. $echo "$modename: \`$vinfo' is not valid version information" 1>&2
  2359. exit 1
  2360. ;;
  2361. esac
  2362. case $revision in
  2363. 0 | [1-9] | [1-9][0-9] | [1-9][0-9][0-9]) ;;
  2364. *)
  2365. $echo "$modename: REVISION \`$revision' is not a nonnegative integer" 1>&2
  2366. $echo "$modename: \`$vinfo' is not valid version information" 1>&2
  2367. exit 1
  2368. ;;
  2369. esac
  2370. case $age in
  2371. 0 | [1-9] | [1-9][0-9] | [1-9][0-9][0-9]) ;;
  2372. *)
  2373. $echo "$modename: AGE \`$age' is not a nonnegative integer" 1>&2
  2374. $echo "$modename: \`$vinfo' is not valid version information" 1>&2
  2375. exit 1
  2376. ;;
  2377. esac
  2378. if test $age -gt $current; then
  2379. $echo "$modename: AGE \`$age' is greater than the current interface number \`$current'" 1>&2
  2380. $echo "$modename: \`$vinfo' is not valid version information" 1>&2
  2381. exit 1
  2382. fi
  2383. # Calculate the version variables.
  2384. major=
  2385. versuffix=
  2386. verstring=
  2387. case $version_type in
  2388. none) ;;
  2389. darwin)
  2390. # Like Linux, but with the current version available in
  2391. # verstring for coding it into the library header
  2392. major=.`expr $current - $age`
  2393. versuffix="$major.$age.$revision"
  2394. # Darwin ld doesn't like 0 for these options...
  2395. minor_current=`expr $current + 1`
  2396. verstring="-compatibility_version $minor_current -current_version $minor_current.$revision"
  2397. ;;
  2398. freebsd-aout)
  2399. major=".$current"
  2400. versuffix=".$current.$revision";
  2401. ;;
  2402. freebsd-elf)
  2403. major=".$current"
  2404. versuffix=".$current";
  2405. ;;
  2406. irix)
  2407. major=`expr $current - $age + 1`
  2408. verstring="sgi$major.$revision"
  2409. # Add in all the interfaces that we are compatible with.
  2410. loop=$revision
  2411. while test $loop != 0; do
  2412. iface=`expr $revision - $loop`
  2413. loop=`expr $loop - 1`
  2414. verstring="sgi$major.$iface:$verstring"
  2415. done
  2416. # Before this point, $major must not contain `.'.
  2417. major=.$major
  2418. versuffix="$major.$revision"
  2419. ;;
  2420. linux)
  2421. major=.`expr $current - $age`
  2422. versuffix="$major.$age.$revision"
  2423. ;;
  2424. osf)
  2425. major=`expr $current - $age`
  2426. versuffix=".$current.$age.$revision"
  2427. verstring="$current.$age.$revision"
  2428. # Add in all the interfaces that we are compatible with.
  2429. loop=$age
  2430. while test $loop != 0; do
  2431. iface=`expr $current - $loop`
  2432. loop=`expr $loop - 1`
  2433. verstring="$verstring:${iface}.0"
  2434. done
  2435. # Make executables depend on our current version.
  2436. verstring="$verstring:${current}.0"
  2437. ;;
  2438. sunos)
  2439. major=".$current"
  2440. versuffix=".$current.$revision"
  2441. ;;
  2442. windows)
  2443. # Use '-' rather than '.', since we only want one
  2444. # extension on DOS 8.3 filesystems.
  2445. major=`expr $current - $age`
  2446. versuffix="-$major"
  2447. ;;
  2448. *)
  2449. $echo "$modename: unknown library version type \`$version_type'" 1>&2
  2450. echo "Fatal configuration error. See the $PACKAGE docs for more information." 1>&2
  2451. exit 1
  2452. ;;
  2453. esac
  2454. # Clear the version info if we defaulted, and they specified a release.
  2455. if test -z "$vinfo" && test -n "$release"; then
  2456. major=
  2457. verstring="0.0"
  2458. if test "$need_version" = no; then
  2459. versuffix=
  2460. else
  2461. versuffix=".0.0"
  2462. fi
  2463. fi
  2464. # Remove version info from name if versioning should be avoided
  2465. if test "$avoid_version" = yes && test "$need_version" = no; then
  2466. major=
  2467. versuffix=
  2468. verstring=""
  2469. fi
  2470. # Check to see if the archive will have undefined symbols.
  2471. if test "$allow_undefined" = yes; then
  2472. if test "$allow_undefined_flag" = unsupported; then
  2473. $echo "$modename: warning: undefined symbols not allowed in $host shared libraries" 1>&2
  2474. build_libtool_libs=no
  2475. build_old_libs=yes
  2476. fi
  2477. else
  2478. # Don't allow undefined symbols.
  2479. allow_undefined_flag="$no_undefined_flag"
  2480. fi
  2481. fi
  2482. if test "$mode" != relink; then
  2483. # Remove our outputs, but don't remove object files since they
  2484. # may have been created when compiling PIC objects.
  2485. removelist=
  2486. tempremovelist=`echo "$output_objdir/*"`
  2487. for p in $tempremovelist; do
  2488. case $p in
  2489. *.$objext)
  2490. ;;
  2491. $output_objdir/$outputname | $output_objdir/$libname.* | $output_objdir/${libname}${release}.*)
  2492. removelist="$removelist $p"
  2493. ;;
  2494. *) ;;
  2495. esac
  2496. done
  2497. if test -n "$removelist"; then
  2498. $show "${rm}r $removelist"
  2499. $run ${rm}r $removelist
  2500. fi
  2501. fi
  2502. # Now set the variables for building old libraries.
  2503. if test "$build_old_libs" = yes && test "$build_libtool_libs" != convenience ; then
  2504. oldlibs="$oldlibs $output_objdir/$libname.$libext"
  2505. # Transform .lo files to .o files.
  2506. oldobjs="$objs "`$echo "X$libobjs" | $SP2NL | $Xsed -e '/\.'${libext}'$/d' -e "$lo2o" | $NL2SP`
  2507. fi
  2508. # Eliminate all temporary directories.
  2509. for path in $notinst_path; do
  2510. lib_search_path=`echo "$lib_search_path " | sed -e 's% $path % %g'`
  2511. deplibs=`echo "$deplibs " | sed -e 's% -L$path % %g'`
  2512. dependency_libs=`echo "$dependency_libs " | sed -e 's% -L$path % %g'`
  2513. done
  2514. if test -n "$xrpath"; then
  2515. # If the user specified any rpath flags, then add them.
  2516. temp_xrpath=
  2517. for libdir in $xrpath; do
  2518. temp_xrpath="$temp_xrpath -R$libdir"
  2519. case "$finalize_rpath " in
  2520. *" $libdir "*) ;;
  2521. *) finalize_rpath="$finalize_rpath $libdir" ;;
  2522. esac
  2523. done
  2524. if test $hardcode_into_libs != yes || test $build_old_libs = yes; then
  2525. dependency_libs="$temp_xrpath $dependency_libs"
  2526. fi
  2527. fi
  2528. # Make sure dlfiles contains only unique files that won't be dlpreopened
  2529. old_dlfiles="$dlfiles"
  2530. dlfiles=
  2531. for lib in $old_dlfiles; do
  2532. case " $dlprefiles $dlfiles " in
  2533. *" $lib "*) ;;
  2534. *) dlfiles="$dlfiles $lib" ;;
  2535. esac
  2536. done
  2537. # Make sure dlprefiles contains only unique files
  2538. old_dlprefiles="$dlprefiles"
  2539. dlprefiles=
  2540. for lib in $old_dlprefiles; do
  2541. case "$dlprefiles " in
  2542. *" $lib "*) ;;
  2543. *) dlprefiles="$dlprefiles $lib" ;;
  2544. esac
  2545. done
  2546. if test "$build_libtool_libs" = yes; then
  2547. if test -n "$rpath"; then
  2548. case $host in
  2549. *-*-cygwin* | *-*-mingw* | *-*-pw32* | *-*-os2* | *-*-beos*)
  2550. # these systems don't actually have a c library (as such)!
  2551. ;;
  2552. *-*-rhapsody* | *-*-darwin1.[012])
  2553. # Rhapsody C library is in the System framework
  2554. deplibs="$deplibs -framework System"
  2555. ;;
  2556. *-*-netbsd*)
  2557. # Don't link with libc until the a.out ld.so is fixed.
  2558. ;;
  2559. *-*-openbsd*)
  2560. # OpenBSD uses either libc or libc_r.
  2561. ;;
  2562. *)
  2563. # Add libc to deplibs on all other systems if necessary.
  2564. if test $build_libtool_need_lc = "yes"; then
  2565. deplibs="$deplibs -lc"
  2566. fi
  2567. ;;
  2568. esac
  2569. fi
  2570. # Transform deplibs into only deplibs that can be linked in shared.
  2571. name_save=$name
  2572. libname_save=$libname
  2573. release_save=$release
  2574. versuffix_save=$versuffix
  2575. major_save=$major
  2576. # I'm not sure if I'm treating the release correctly. I think
  2577. # release should show up in the -l (ie -lgmp5) so we don't want to
  2578. # add it in twice. Is that correct?
  2579. release=""
  2580. versuffix=""
  2581. major=""
  2582. newdeplibs=
  2583. droppeddeps=no
  2584. case $deplibs_check_method in
  2585. pass_all)
  2586. # Don't check for shared/static. Everything works.
  2587. # This might be a little naive. We might want to check
  2588. # whether the library exists or not. But this is on
  2589. # osf3 & osf4 and I'm not really sure... Just
  2590. # implementing what was already the behaviour.
  2591. newdeplibs=$deplibs
  2592. ;;
  2593. test_compile)
  2594. # This code stresses the "libraries are programs" paradigm to its
  2595. # limits. Maybe even breaks it. We compile a program, linking it
  2596. # against the deplibs as a proxy for the library. Then we can check
  2597. # whether they linked in statically or dynamically with ldd.
  2598. $rm conftest.c
  2599. cat > conftest.c <<EOF
  2600. int main() { return 0; }
  2601. EOF
  2602. $rm conftest
  2603. $LTCC -o conftest conftest.c $deplibs
  2604. if test $? -eq 0 ; then
  2605. ldd_output=`ldd conftest`
  2606. for i in $deplibs; do
  2607. name="`expr $i : '-l\(.*\)'`"
  2608. # If $name is empty we are operating on a -L argument.
  2609. if test "$name" != "" -a "$name" != "0"; then
  2610. libname=`eval \\$echo \"$libname_spec\"`
  2611. deplib_matches=`eval \\$echo \"$library_names_spec\"`
  2612. set dummy $deplib_matches
  2613. deplib_match=$2
  2614. if test `expr "$ldd_output" : ".*$deplib_match"` -ne 0 ; then
  2615. newdeplibs="$newdeplibs $i"
  2616. else
  2617. droppeddeps=yes
  2618. echo
  2619. echo "*** Warning: This library needs some functionality provided by $i."
  2620. echo "*** I have the capability to make that library automatically link in when"
  2621. echo "*** you link to this library. But I can only do this if you have a"
  2622. echo "*** shared version of the library, which you do not appear to have."
  2623. fi
  2624. else
  2625. newdeplibs="$newdeplibs $i"
  2626. fi
  2627. done
  2628. else
  2629. # Error occured in the first compile. Let's try to salvage the situation:
  2630. # Compile a seperate program for each library.
  2631. for i in $deplibs; do
  2632. name="`expr $i : '-l\(.*\)'`"
  2633. # If $name is empty we are operating on a -L argument.
  2634. if test "$name" != "" -a "$name" != "0"; then
  2635. $rm conftest
  2636. $LTCC -o conftest conftest.c $i
  2637. # Did it work?
  2638. if test $? -eq 0 ; then
  2639. ldd_output=`ldd conftest`
  2640. libname=`eval \\$echo \"$libname_spec\"`
  2641. deplib_matches=`eval \\$echo \"$library_names_spec\"`
  2642. set dummy $deplib_matches
  2643. deplib_match=$2
  2644. if test `expr "$ldd_output" : ".*$deplib_match"` -ne 0 ; then
  2645. newdeplibs="$newdeplibs $i"
  2646. else
  2647. droppeddeps=yes
  2648. echo
  2649. echo "*** Warning: This library needs some functionality provided by $i."
  2650. echo "*** I have the capability to make that library automatically link in when"
  2651. echo "*** you link to this library. But I can only do this if you have a"
  2652. echo "*** shared version of the library, which you do not appear to have."
  2653. fi
  2654. else
  2655. droppeddeps=yes
  2656. echo
  2657. echo "*** Warning! Library $i is needed by this library but I was not able to"
  2658. echo "*** make it link in! You will probably need to install it or some"
  2659. echo "*** library that it depends on before this library will be fully"
  2660. echo "*** functional. Installing it before continuing would be even better."
  2661. fi
  2662. else
  2663. newdeplibs="$newdeplibs $i"
  2664. fi
  2665. done
  2666. fi
  2667. ;;
  2668. file_magic*)
  2669. set dummy $deplibs_check_method
  2670. file_magic_regex=`expr "$deplibs_check_method" : "$2 \(.*\)"`
  2671. for a_deplib in $deplibs; do
  2672. name="`expr $a_deplib : '-l\(.*\)'`"
  2673. # If $name is empty we are operating on a -L argument.
  2674. if test "$name" != "" -a "$name" != "0"; then
  2675. libname=`eval \\$echo \"$libname_spec\"`
  2676. for i in $lib_search_path $sys_lib_search_path $shlib_search_path; do
  2677. potential_libs=`ls $i/$libname[.-]* 2>/dev/null`
  2678. for potent_lib in $potential_libs; do
  2679. # Follow soft links.
  2680. if ls -lLd "$potent_lib" 2>/dev/null \
  2681. | grep " -> " >/dev/null; then
  2682. continue
  2683. fi
  2684. # The statement above tries to avoid entering an
  2685. # endless loop below, in case of cyclic links.
  2686. # We might still enter an endless loop, since a link
  2687. # loop can be closed while we follow links,
  2688. # but so what?
  2689. potlib="$potent_lib"
  2690. while test -h "$potlib" 2>/dev/null; do
  2691. potliblink=`ls -ld $potlib | sed 's/.* -> //'`
  2692. case $potliblink in
  2693. [\\/]* | [A-Za-z]:[\\/]*) potlib="$potliblink";;
  2694. *) potlib=`$echo "X$potlib" | $Xsed -e 's,[^/]*$,,'`"$potliblink";;
  2695. esac
  2696. done
  2697. if eval $file_magic_cmd \"\$potlib\" 2>/dev/null \
  2698. | sed 10q \
  2699. | egrep "$file_magic_regex" > /dev/null; then
  2700. newdeplibs="$newdeplibs $a_deplib"
  2701. a_deplib=""
  2702. break 2
  2703. fi
  2704. done
  2705. done
  2706. if test -n "$a_deplib" ; then
  2707. droppeddeps=yes
  2708. echo
  2709. echo "*** Warning: This library needs some functionality provided by $a_deplib."
  2710. echo "*** I have the capability to make that library automatically link in when"
  2711. echo "*** you link to this library. But I can only do this if you have a"
  2712. echo "*** shared version of the library, which you do not appear to have."
  2713. fi
  2714. else
  2715. # Add a -L argument.
  2716. newdeplibs="$newdeplibs $a_deplib"
  2717. fi
  2718. done # Gone through all deplibs.
  2719. ;;
  2720. match_pattern*)
  2721. set dummy $deplibs_check_method
  2722. match_pattern_regex=`expr "$deplibs_check_method" : "$2 \(.*\)"`
  2723. for a_deplib in $deplibs; do
  2724. name="`expr $a_deplib : '-l\(.*\)'`"
  2725. # If $name is empty we are operating on a -L argument.
  2726. if test -n "$name" && test "$name" != "0"; then
  2727. libname=`eval \\$echo \"$libname_spec\"`
  2728. for i in $lib_search_path $sys_lib_search_path $shlib_search_path; do
  2729. potential_libs=`ls $i/$libname[.-]* 2>/dev/null`
  2730. for potent_lib in $potential_libs; do
  2731. if eval echo \"$potent_lib\" 2>/dev/null \
  2732. | sed 10q \
  2733. | egrep "$match_pattern_regex" > /dev/null; then
  2734. newdeplibs="$newdeplibs $a_deplib"
  2735. a_deplib=""
  2736. break 2
  2737. fi
  2738. done
  2739. done
  2740. if test -n "$a_deplib" ; then
  2741. droppeddeps=yes
  2742. echo
  2743. echo "*** Warning: This library needs some functionality provided by $a_deplib."
  2744. echo "*** I have the capability to make that library automatically link in when"
  2745. echo "*** you link to this library. But I can only do this if you have a"
  2746. echo "*** shared version of the library, which you do not appear to have."
  2747. fi
  2748. else
  2749. # Add a -L argument.
  2750. newdeplibs="$newdeplibs $a_deplib"
  2751. fi
  2752. done # Gone through all deplibs.
  2753. ;;
  2754. none | unknown | *)
  2755. newdeplibs=""
  2756. if $echo "X $deplibs" | $Xsed -e 's/ -lc$//' \
  2757. -e 's/ -[LR][^ ]*//g' -e 's/[ ]//g' |
  2758. grep . >/dev/null; then
  2759. echo
  2760. if test "X$deplibs_check_method" = "Xnone"; then
  2761. echo "*** Warning: inter-library dependencies are not supported in this platform."
  2762. else
  2763. echo "*** Warning: inter-library dependencies are not known to be supported."
  2764. fi
  2765. echo "*** All declared inter-library dependencies are being dropped."
  2766. droppeddeps=yes
  2767. fi
  2768. ;;
  2769. esac
  2770. versuffix=$versuffix_save
  2771. major=$major_save
  2772. release=$release_save
  2773. libname=$libname_save
  2774. name=$name_save
  2775. case $host in
  2776. *-*-rhapsody* | *-*-darwin1.[012])
  2777. # On Rhapsody replace the C library is the System framework
  2778. newdeplibs=`$echo "X $newdeplibs" | $Xsed -e 's/ -lc / -framework System /'`
  2779. ;;
  2780. esac
  2781. if test "$droppeddeps" = yes; then
  2782. if test "$module" = yes; then
  2783. echo
  2784. echo "*** Warning: libtool could not satisfy all declared inter-library"
  2785. echo "*** dependencies of module $libname. Therefore, libtool will create"
  2786. echo "*** a static module, that should work as long as the dlopening"
  2787. echo "*** application is linked with the -dlopen flag."
  2788. if test -z "$global_symbol_pipe"; then
  2789. echo
  2790. echo "*** However, this would only work if libtool was able to extract symbol"
  2791. echo "*** lists from a program, using \`nm' or equivalent, but libtool could"
  2792. echo "*** not find such a program. So, this module is probably useless."
  2793. echo "*** \`nm' from GNU binutils and a full rebuild may help."
  2794. fi
  2795. if test "$build_old_libs" = no; then
  2796. oldlibs="$output_objdir/$libname.$libext"
  2797. build_libtool_libs=module
  2798. build_old_libs=yes
  2799. else
  2800. build_libtool_libs=no
  2801. fi
  2802. else
  2803. echo "*** The inter-library dependencies that have been dropped here will be"
  2804. echo "*** automatically added whenever a program is linked with this library"
  2805. echo "*** or is declared to -dlopen it."
  2806. if test $allow_undefined = no; then
  2807. echo
  2808. echo "*** Since this library must not contain undefined symbols,"
  2809. echo "*** because either the platform does not support them or"
  2810. echo "*** it was explicitly requested with -no-undefined,"
  2811. echo "*** libtool will only create a static version of it."
  2812. if test "$build_old_libs" = no; then
  2813. oldlibs="$output_objdir/$libname.$libext"
  2814. build_libtool_libs=module
  2815. build_old_libs=yes
  2816. else
  2817. build_libtool_libs=no
  2818. fi
  2819. fi
  2820. fi
  2821. fi
  2822. # Done checking deplibs!
  2823. deplibs=$newdeplibs
  2824. fi
  2825. # All the library-specific variables (install_libdir is set above).
  2826. library_names=
  2827. old_library=
  2828. dlname=
  2829. # Test again, we may have decided not to build it any more
  2830. if test "$build_libtool_libs" = yes; then
  2831. if test $hardcode_into_libs = yes; then
  2832. # Hardcode the library paths
  2833. hardcode_libdirs=
  2834. dep_rpath=
  2835. rpath="$finalize_rpath"
  2836. test "$mode" != relink && rpath="$compile_rpath$rpath"
  2837. for libdir in $rpath; do
  2838. if test -n "$hardcode_libdir_flag_spec"; then
  2839. if test -n "$hardcode_libdir_separator"; then
  2840. if test -z "$hardcode_libdirs"; then
  2841. hardcode_libdirs="$libdir"
  2842. else
  2843. # Just accumulate the unique libdirs.
  2844. case $hardcode_libdir_separator$hardcode_libdirs$hardcode_libdir_separator in
  2845. *"$hardcode_libdir_separator$libdir$hardcode_libdir_separator"*)
  2846. ;;
  2847. *)
  2848. hardcode_libdirs="$hardcode_libdirs$hardcode_libdir_separator$libdir"
  2849. ;;
  2850. esac
  2851. fi
  2852. else
  2853. eval flag=\"$hardcode_libdir_flag_spec\"
  2854. dep_rpath="$dep_rpath $flag"
  2855. fi
  2856. elif test -n "$runpath_var"; then
  2857. case "$perm_rpath " in
  2858. *" $libdir "*) ;;
  2859. *) perm_rpath="$perm_rpath $libdir" ;;
  2860. esac
  2861. fi
  2862. done
  2863. # Substitute the hardcoded libdirs into the rpath.
  2864. if test -n "$hardcode_libdir_separator" &&
  2865. test -n "$hardcode_libdirs"; then
  2866. libdir="$hardcode_libdirs"
  2867. eval dep_rpath=\"$hardcode_libdir_flag_spec\"
  2868. fi
  2869. if test -n "$runpath_var" && test -n "$perm_rpath"; then
  2870. # We should set the runpath_var.
  2871. rpath=
  2872. for dir in $perm_rpath; do
  2873. rpath="$rpath$dir:"
  2874. done
  2875. eval "$runpath_var='$rpath\$$runpath_var'; export $runpath_var"
  2876. fi
  2877. test -n "$dep_rpath" && deplibs="$dep_rpath $deplibs"
  2878. fi
  2879. shlibpath="$finalize_shlibpath"
  2880. test "$mode" != relink && shlibpath="$compile_shlibpath$shlibpath"
  2881. if test -n "$shlibpath"; then
  2882. eval "$shlibpath_var='$shlibpath\$$shlibpath_var'; export $shlibpath_var"
  2883. fi
  2884. # Get the real and link names of the library.
  2885. eval library_names=\"$library_names_spec\"
  2886. set dummy $library_names
  2887. realname="$2"
  2888. shift; shift
  2889. if test -n "$soname_spec"; then
  2890. eval soname=\"$soname_spec\"
  2891. else
  2892. soname="$realname"
  2893. fi
  2894. if test x$dlname = x; then
  2895. dlname=$soname
  2896. fi
  2897. lib="$output_objdir/$realname"
  2898. for link
  2899. do
  2900. linknames="$linknames $link"
  2901. done
  2902. # Use standard objects if they are pic
  2903. test -z "$pic_flag" && libobjs=`$echo "X$libobjs" | $SP2NL | $Xsed -e "$lo2o" | $NL2SP`
  2904. # Prepare the list of exported symbols
  2905. if test -z "$export_symbols"; then
  2906. if test "$always_export_symbols" = yes || test -n "$export_symbols_regex"; then
  2907. $show "generating symbol list for \`$libname.la'"
  2908. export_symbols="$output_objdir/$libname.exp"
  2909. $run $rm $export_symbols
  2910. eval cmds=\"$export_symbols_cmds\"
  2911. IFS="${IFS= }"; save_ifs="$IFS"; IFS='~'
  2912. for cmd in $cmds; do
  2913. IFS="$save_ifs"
  2914. $show "$cmd"
  2915. $run eval "$cmd" || exit $?
  2916. done
  2917. IFS="$save_ifs"
  2918. if test -n "$export_symbols_regex"; then
  2919. $show "egrep -e \"$export_symbols_regex\" \"$export_symbols\" > \"${export_symbols}T\""
  2920. $run eval 'egrep -e "$export_symbols_regex" "$export_symbols" > "${export_symbols}T"'
  2921. $show "$mv \"${export_symbols}T\" \"$export_symbols\""
  2922. $run eval '$mv "${export_symbols}T" "$export_symbols"'
  2923. fi
  2924. fi
  2925. fi
  2926. if test -n "$export_symbols" && test -n "$include_expsyms"; then
  2927. $run eval '$echo "X$include_expsyms" | $SP2NL >> "$export_symbols"'
  2928. fi
  2929. if test -n "$convenience"; then
  2930. if test -n "$whole_archive_flag_spec"; then
  2931. save_libobjs=$libobjs
  2932. eval libobjs=\"\$libobjs $whole_archive_flag_spec\"
  2933. else
  2934. gentop="$output_objdir/${outputname}x"
  2935. $show "${rm}r $gentop"
  2936. $run ${rm}r "$gentop"
  2937. $show "$mkdir $gentop"
  2938. $run $mkdir "$gentop"
  2939. status=$?
  2940. if test $status -ne 0 && test ! -d "$gentop"; then
  2941. exit $status
  2942. fi
  2943. generated="$generated $gentop"
  2944. for xlib in $convenience; do
  2945. # Extract the objects.
  2946. case $xlib in
  2947. [\\/]* | [A-Za-z]:[\\/]*) xabs="$xlib" ;;
  2948. *) xabs=`pwd`"/$xlib" ;;
  2949. esac
  2950. xlib=`$echo "X$xlib" | $Xsed -e 's%^.*/%%'`
  2951. xdir="$gentop/$xlib"
  2952. $show "${rm}r $xdir"
  2953. $run ${rm}r "$xdir"
  2954. $show "$mkdir $xdir"
  2955. $run $mkdir "$xdir"
  2956. status=$?
  2957. if test $status -ne 0 && test ! -d "$xdir"; then
  2958. exit $status
  2959. fi
  2960. $show "(cd $xdir && $AR x $xabs)"
  2961. $run eval "(cd \$xdir && $AR x \$xabs)" || exit $?
  2962. libobjs="$libobjs "`find $xdir -name \*.$objext -print -o -name \*.lo -print | $NL2SP`
  2963. done
  2964. fi
  2965. fi
  2966. if test "$thread_safe" = yes && test -n "$thread_safe_flag_spec"; then
  2967. eval flag=\"$thread_safe_flag_spec\"
  2968. linker_flags="$linker_flags $flag"
  2969. fi
  2970. # Make a backup of the uninstalled library when relinking
  2971. if test "$mode" = relink; then
  2972. $run eval '(cd $output_objdir && $rm ${realname}U && $mv $realname ${realname}U)' || exit $?
  2973. fi
  2974. # Do each of the archive commands.
  2975. if test -n "$export_symbols" && test -n "$archive_expsym_cmds"; then
  2976. eval cmds=\"$archive_expsym_cmds\"
  2977. else
  2978. eval cmds=\"$archive_cmds\"
  2979. fi
  2980. if len=`expr "X$cmds" : ".*"` &&
  2981. test $len -le $max_cmd_len || test $max_cmd_len -le -1; then
  2982. :
  2983. else
  2984. # The command line is too long to link in one step, link piecewise.
  2985. $echo "creating reloadable object files..."
  2986. # Save the value of $output and $libobjs because we want to
  2987. # use them later. If we have whole_archive_flag_spec, we
  2988. # want to use save_libobjs as it was before
  2989. # whole_archive_flag_spec was expanded, because we can't
  2990. # assume the linker understands whole_archive_flag_spec.
  2991. # This may have to be revisited, in case too many
  2992. # convenience libraries get linked in and end up exceeding
  2993. # the spec.
  2994. if test -z "$convenience" || test -z "$whole_archive_flag_spec"; then
  2995. save_libobjs=$libobjs
  2996. fi
  2997. save_output=$output
  2998. # Clear the reloadable object creation command queue and
  2999. # initialize k to one.
  3000. test_cmds=
  3001. concat_cmds=
  3002. objlist=
  3003. delfiles=
  3004. last_robj=
  3005. k=1
  3006. output=$output_objdir/$save_output-${k}.$objext
  3007. # Loop over the list of objects to be linked.
  3008. for obj in $save_libobjs
  3009. do
  3010. eval test_cmds=\"$reload_cmds $objlist $last_robj\"
  3011. if test "X$objlist" = X ||
  3012. { len=`expr "X$test_cmds" : ".*"` &&
  3013. test $len -le $max_cmd_len; }; then
  3014. objlist="$objlist $obj"
  3015. else
  3016. # The command $test_cmds is almost too long, add a
  3017. # command to the queue.
  3018. if test $k -eq 1 ; then
  3019. # The first file doesn't have a previous command to add.
  3020. eval concat_cmds=\"$reload_cmds $objlist $last_robj\"
  3021. else
  3022. # All subsequent reloadable object files will link in
  3023. # the last one created.
  3024. eval concat_cmds=\"\$concat_cmds~$reload_cmds $objlist $last_robj\"
  3025. fi
  3026. last_robj=$output_objdir/$save_output-${k}.$objext
  3027. k=`expr $k + 1`
  3028. output=$output_objdir/$save_output-${k}.$objext
  3029. objlist=$obj
  3030. len=1
  3031. fi
  3032. done
  3033. # Handle the remaining objects by creating one last
  3034. # reloadable object file. All subsequent reloadable object
  3035. # files will link in the last one created.
  3036. test -z "$concat_cmds" || concat_cmds=$concat_cmds~
  3037. eval concat_cmds=\"\${concat_cmds}$reload_cmds $objlist $last_robj\"
  3038. # Set up a command to remove the reloadale object files
  3039. # after they are used.
  3040. i=0
  3041. while test $i -lt $k
  3042. do
  3043. i=`expr $i + 1`
  3044. delfiles="$delfiles $output_objdir/$save_output-${i}.$objext"
  3045. done
  3046. $echo "creating a temporary reloadable object file: $output"
  3047. # Loop through the commands generated above and execute them.
  3048. IFS="${IFS= }"; save_ifs="$IFS"; IFS='~'
  3049. for cmd in $concat_cmds; do
  3050. IFS="$save_ifs"
  3051. $show "$cmd"
  3052. $run eval "$cmd" || exit $?
  3053. done
  3054. IFS="$save_ifs"
  3055. libobjs=$output
  3056. # Restore the value of output.
  3057. output=$save_output
  3058. if test -n "$convenience" && test -n "$whole_archive_flag_spec"; then
  3059. eval libobjs=\"\$libobjs $whole_archive_flag_spec\"
  3060. fi
  3061. # Expand the library linking commands again to reset the
  3062. # value of $libobjs for piecewise linking.
  3063. # Do each of the archive commands.
  3064. if test -n "$export_symbols" && test -n "$archive_expsym_cmds"; then
  3065. eval cmds=\"$archive_expsym_cmds\"
  3066. else
  3067. eval cmds=\"$archive_cmds\"
  3068. fi
  3069. # Append the command to remove the reloadable object files
  3070. # to the just-reset $cmds.
  3071. eval cmds=\"\$cmds~$rm $delfiles\"
  3072. fi
  3073. IFS="${IFS= }"; save_ifs="$IFS"; IFS='~'
  3074. for cmd in $cmds; do
  3075. IFS="$save_ifs"
  3076. $show "$cmd"
  3077. $run eval "$cmd" || exit $?
  3078. done
  3079. IFS="$save_ifs"
  3080. # Restore the uninstalled library and exit
  3081. if test "$mode" = relink; then
  3082. $run eval '(cd $output_objdir && $rm ${realname}T && $mv $realname ${realname}T && $mv "$realname"U $realname)' || exit $?
  3083. exit 0
  3084. fi
  3085. # Create links to the real library.
  3086. for linkname in $linknames; do
  3087. if test "$realname" != "$linkname"; then
  3088. $show "(cd $output_objdir && $rm $linkname && $LN_S $realname $linkname)"
  3089. $run eval '(cd $output_objdir && $rm $linkname && $LN_S $realname $linkname)' || exit $?
  3090. fi
  3091. done
  3092. # If -module or -export-dynamic was specified, set the dlname.
  3093. if test "$module" = yes || test "$export_dynamic" = yes; then
  3094. # On all known operating systems, these are identical.
  3095. dlname="$soname"
  3096. fi
  3097. fi
  3098. ;;
  3099. obj)
  3100. if test -n "$deplibs"; then
  3101. $echo "$modename: warning: \`-l' and \`-L' are ignored for objects" 1>&2
  3102. fi
  3103. if test -n "$dlfiles$dlprefiles" || test "$dlself" != no; then
  3104. $echo "$modename: warning: \`-dlopen' is ignored for objects" 1>&2
  3105. fi
  3106. if test -n "$rpath"; then
  3107. $echo "$modename: warning: \`-rpath' is ignored for objects" 1>&2
  3108. fi
  3109. if test -n "$xrpath"; then
  3110. $echo "$modename: warning: \`-R' is ignored for objects" 1>&2
  3111. fi
  3112. if test -n "$vinfo"; then
  3113. $echo "$modename: warning: \`-version-info' is ignored for objects" 1>&2
  3114. fi
  3115. if test -n "$release"; then
  3116. $echo "$modename: warning: \`-release' is ignored for objects" 1>&2
  3117. fi
  3118. case $output in
  3119. *.lo)
  3120. if test -n "$objs$old_deplibs"; then
  3121. $echo "$modename: cannot build library object \`$output' from non-libtool objects" 1>&2
  3122. exit 1
  3123. fi
  3124. libobj="$output"
  3125. obj=`$echo "X$output" | $Xsed -e "$lo2o"`
  3126. ;;
  3127. *)
  3128. libobj=
  3129. obj="$output"
  3130. ;;
  3131. esac
  3132. # Delete the old objects.
  3133. $run $rm $obj $libobj
  3134. # Objects from convenience libraries. This assumes
  3135. # single-version convenience libraries. Whenever we create
  3136. # different ones for PIC/non-PIC, this we'll have to duplicate
  3137. # the extraction.
  3138. reload_conv_objs=
  3139. gentop=
  3140. # reload_cmds runs $LD directly, so let us get rid of
  3141. # -Wl from whole_archive_flag_spec
  3142. wl=
  3143. if test -n "$convenience"; then
  3144. if test -n "$whole_archive_flag_spec"; then
  3145. eval reload_conv_objs=\"\$reload_objs $whole_archive_flag_spec\"
  3146. else
  3147. gentop="$output_objdir/${obj}x"
  3148. $show "${rm}r $gentop"
  3149. $run ${rm}r "$gentop"
  3150. $show "$mkdir $gentop"
  3151. $run $mkdir "$gentop"
  3152. status=$?
  3153. if test $status -ne 0 && test ! -d "$gentop"; then
  3154. exit $status
  3155. fi
  3156. generated="$generated $gentop"
  3157. for xlib in $convenience; do
  3158. # Extract the objects.
  3159. case $xlib in
  3160. [\\/]* | [A-Za-z]:[\\/]*) xabs="$xlib" ;;
  3161. *) xabs=`pwd`"/$xlib" ;;
  3162. esac
  3163. xlib=`$echo "X$xlib" | $Xsed -e 's%^.*/%%'`
  3164. xdir="$gentop/$xlib"
  3165. $show "${rm}r $xdir"
  3166. $run ${rm}r "$xdir"
  3167. $show "$mkdir $xdir"
  3168. $run $mkdir "$xdir"
  3169. status=$?
  3170. if test $status -ne 0 && test ! -d "$xdir"; then
  3171. exit $status
  3172. fi
  3173. $show "(cd $xdir && $AR x $xabs)"
  3174. $run eval "(cd \$xdir && $AR x \$xabs)" || exit $?
  3175. reload_conv_objs="$reload_objs "`find $xdir -name \*.$objext -print -o -name \*.lo -print | $NL2SP`
  3176. done
  3177. fi
  3178. fi
  3179. # Create the old-style object.
  3180. 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
  3181. output="$obj"
  3182. eval cmds=\"$reload_cmds\"
  3183. IFS="${IFS= }"; save_ifs="$IFS"; IFS='~'
  3184. for cmd in $cmds; do
  3185. IFS="$save_ifs"
  3186. $show "$cmd"
  3187. $run eval "$cmd" || exit $?
  3188. done
  3189. IFS="$save_ifs"
  3190. # Exit if we aren't doing a library object file.
  3191. if test -z "$libobj"; then
  3192. if test -n "$gentop"; then
  3193. $show "${rm}r $gentop"
  3194. $run ${rm}r $gentop
  3195. fi
  3196. exit 0
  3197. fi
  3198. if test "$build_libtool_libs" != yes; then
  3199. if test -n "$gentop"; then
  3200. $show "${rm}r $gentop"
  3201. $run ${rm}r $gentop
  3202. fi
  3203. # Create an invalid libtool object if no PIC, so that we don't
  3204. # accidentally link it into a program.
  3205. # $show "echo timestamp > $libobj"
  3206. # $run eval "echo timestamp > $libobj" || exit $?
  3207. exit 0
  3208. fi
  3209. if test -n "$pic_flag" || test "$pic_mode" != default; then
  3210. # Only do commands if we really have different PIC objects.
  3211. reload_objs="$libobjs $reload_conv_objs"
  3212. output="$libobj"
  3213. eval cmds=\"$reload_cmds\"
  3214. IFS="${IFS= }"; save_ifs="$IFS"; IFS='~'
  3215. for cmd in $cmds; do
  3216. IFS="$save_ifs"
  3217. $show "$cmd"
  3218. $run eval "$cmd" || exit $?
  3219. done
  3220. IFS="$save_ifs"
  3221. fi
  3222. if test -n "$gentop"; then
  3223. $show "${rm}r $gentop"
  3224. $run ${rm}r $gentop
  3225. fi
  3226. exit 0
  3227. ;;
  3228. prog)
  3229. case $host in
  3230. *cygwin*) output=`echo $output | sed -e 's,.exe$,,;s,$,.exe,'` ;;
  3231. esac
  3232. if test -n "$vinfo"; then
  3233. $echo "$modename: warning: \`-version-info' is ignored for programs" 1>&2
  3234. fi
  3235. if test -n "$release"; then
  3236. $echo "$modename: warning: \`-release' is ignored for programs" 1>&2
  3237. fi
  3238. if test "$preload" = yes; then
  3239. if test "$dlopen_support" = unknown && test "$dlopen_self" = unknown &&
  3240. test "$dlopen_self_static" = unknown; then
  3241. $echo "$modename: warning: \`AC_LIBTOOL_DLOPEN' not used. Assuming no dlopen support."
  3242. fi
  3243. fi
  3244. case $host in
  3245. *-*-rhapsody* | *-*-darwin1.[012])
  3246. # On Rhapsody replace the C library is the System framework
  3247. compile_deplibs=`$echo "X $compile_deplibs" | $Xsed -e 's/ -lc / -framework System /'`
  3248. finalize_deplibs=`$echo "X $finalize_deplibs" | $Xsed -e 's/ -lc / -framework System /'`
  3249. ;;
  3250. esac
  3251. compile_command="$compile_command $compile_deplibs"
  3252. finalize_command="$finalize_command $finalize_deplibs"
  3253. if test -n "$rpath$xrpath"; then
  3254. # If the user specified any rpath flags, then add them.
  3255. for libdir in $rpath $xrpath; do
  3256. # This is the magic to use -rpath.
  3257. case "$finalize_rpath " in
  3258. *" $libdir "*) ;;
  3259. *) finalize_rpath="$finalize_rpath $libdir" ;;
  3260. esac
  3261. done
  3262. fi
  3263. # Now hardcode the library paths
  3264. rpath=
  3265. hardcode_libdirs=
  3266. for libdir in $compile_rpath $finalize_rpath; do
  3267. if test -n "$hardcode_libdir_flag_spec"; then
  3268. if test -n "$hardcode_libdir_separator"; then
  3269. if test -z "$hardcode_libdirs"; then
  3270. hardcode_libdirs="$libdir"
  3271. else
  3272. # Just accumulate the unique libdirs.
  3273. case $hardcode_libdir_separator$hardcode_libdirs$hardcode_libdir_separator in
  3274. *"$hardcode_libdir_separator$libdir$hardcode_libdir_separator"*)
  3275. ;;
  3276. *)
  3277. hardcode_libdirs="$hardcode_libdirs$hardcode_libdir_separator$libdir"
  3278. ;;
  3279. esac
  3280. fi
  3281. else
  3282. eval flag=\"$hardcode_libdir_flag_spec\"
  3283. rpath="$rpath $flag"
  3284. fi
  3285. elif test -n "$runpath_var"; then
  3286. case "$perm_rpath " in
  3287. *" $libdir "*) ;;
  3288. *) perm_rpath="$perm_rpath $libdir" ;;
  3289. esac
  3290. fi
  3291. case $host in
  3292. *-*-cygwin* | *-*-mingw* | *-*-pw32* | *-*-os2*)
  3293. case :$dllsearchpath: in
  3294. *":$libdir:"*) ;;
  3295. *) dllsearchpath="$dllsearchpath:$libdir";;
  3296. esac
  3297. ;;
  3298. esac
  3299. done
  3300. # Substitute the hardcoded libdirs into the rpath.
  3301. if test -n "$hardcode_libdir_separator" &&
  3302. test -n "$hardcode_libdirs"; then
  3303. libdir="$hardcode_libdirs"
  3304. eval rpath=\" $hardcode_libdir_flag_spec\"
  3305. fi
  3306. compile_rpath="$rpath"
  3307. rpath=
  3308. hardcode_libdirs=
  3309. for libdir in $finalize_rpath; do
  3310. if test -n "$hardcode_libdir_flag_spec"; then
  3311. if test -n "$hardcode_libdir_separator"; then
  3312. if test -z "$hardcode_libdirs"; then
  3313. hardcode_libdirs="$libdir"
  3314. else
  3315. # Just accumulate the unique libdirs.
  3316. case $hardcode_libdir_separator$hardcode_libdirs$hardcode_libdir_separator in
  3317. *"$hardcode_libdir_separator$libdir$hardcode_libdir_separator"*)
  3318. ;;
  3319. *)
  3320. hardcode_libdirs="$hardcode_libdirs$hardcode_libdir_separator$libdir"
  3321. ;;
  3322. esac
  3323. fi
  3324. else
  3325. eval flag=\"$hardcode_libdir_flag_spec\"
  3326. rpath="$rpath $flag"
  3327. fi
  3328. elif test -n "$runpath_var"; then
  3329. case "$finalize_perm_rpath " in
  3330. *" $libdir "*) ;;
  3331. *) finalize_perm_rpath="$finalize_perm_rpath $libdir" ;;
  3332. esac
  3333. fi
  3334. done
  3335. # Substitute the hardcoded libdirs into the rpath.
  3336. if test -n "$hardcode_libdir_separator" &&
  3337. test -n "$hardcode_libdirs"; then
  3338. libdir="$hardcode_libdirs"
  3339. eval rpath=\" $hardcode_libdir_flag_spec\"
  3340. fi
  3341. finalize_rpath="$rpath"
  3342. if test -n "$libobjs" && test "$build_old_libs" = yes; then
  3343. # Transform all the library objects into standard objects.
  3344. compile_command=`$echo "X$compile_command" | $SP2NL | $Xsed -e "$lo2o" | $NL2SP`
  3345. finalize_command=`$echo "X$finalize_command" | $SP2NL | $Xsed -e "$lo2o" | $NL2SP`
  3346. fi
  3347. dlsyms=
  3348. if test -n "$dlfiles$dlprefiles" || test "$dlself" != no; then
  3349. if test -n "$NM" && test -n "$global_symbol_pipe"; then
  3350. dlsyms="${outputname}S.c"
  3351. else
  3352. $echo "$modename: not configured to extract global symbols from dlpreopened files" 1>&2
  3353. fi
  3354. fi
  3355. if test -n "$dlsyms"; then
  3356. case $dlsyms in
  3357. "") ;;
  3358. *.c)
  3359. # Discover the nlist of each of the dlfiles.
  3360. nlist="$output_objdir/${outputname}.nm"
  3361. $show "$rm $nlist ${nlist}S ${nlist}T"
  3362. $run $rm "$nlist" "${nlist}S" "${nlist}T"
  3363. # Parse the name list into a source file.
  3364. $show "creating $output_objdir/$dlsyms"
  3365. test -z "$run" && $echo > "$output_objdir/$dlsyms" "\
  3366. /* $dlsyms - symbol resolution table for \`$outputname' dlsym emulation. */
  3367. /* Generated by $PROGRAM - GNU $PACKAGE $VERSION$TIMESTAMP */
  3368. #ifdef __cplusplus
  3369. extern \"C\" {
  3370. #endif
  3371. /* Prevent the only kind of declaration conflicts we can make. */
  3372. #define lt_preloaded_symbols some_other_symbol
  3373. /* External symbol declarations for the compiler. */\
  3374. "
  3375. if test "$dlself" = yes; then
  3376. $show "generating symbol list for \`$output'"
  3377. test -z "$run" && $echo ': @PROGRAM@ ' > "$nlist"
  3378. # Add our own program objects to the symbol list.
  3379. progfiles=`$echo "X$objs$old_deplibs" | $SP2NL | $Xsed -e "$lo2o" | $NL2SP`
  3380. for arg in $progfiles; do
  3381. $show "extracting global C symbols from \`$arg'"
  3382. $run eval "$NM $arg | $global_symbol_pipe >> '$nlist'"
  3383. done
  3384. if test -n "$exclude_expsyms"; then
  3385. $run eval 'egrep -v " ($exclude_expsyms)$" "$nlist" > "$nlist"T'
  3386. $run eval '$mv "$nlist"T "$nlist"'
  3387. fi
  3388. if test -n "$export_symbols_regex"; then
  3389. $run eval 'egrep -e "$export_symbols_regex" "$nlist" > "$nlist"T'
  3390. $run eval '$mv "$nlist"T "$nlist"'
  3391. fi
  3392. # Prepare the list of exported symbols
  3393. if test -z "$export_symbols"; then
  3394. export_symbols="$output_objdir/$output.exp"
  3395. $run $rm $export_symbols
  3396. $run eval "sed -n -e '/^: @PROGRAM@$/d' -e 's/^.* \(.*\)$/\1/p' "'< "$nlist" > "$export_symbols"'
  3397. else
  3398. $run eval "sed -e 's/\([][.*^$]\)/\\\1/g' -e 's/^/ /' -e 's/$/$/'"' < "$export_symbols" > "$output_objdir/$output.exp"'
  3399. $run eval 'grep -f "$output_objdir/$output.exp" < "$nlist" > "$nlist"T'
  3400. $run eval 'mv "$nlist"T "$nlist"'
  3401. fi
  3402. fi
  3403. for arg in $dlprefiles; do
  3404. $show "extracting global C symbols from \`$arg'"
  3405. name=`echo "$arg" | sed -e 's%^.*/%%'`
  3406. $run eval 'echo ": $name " >> "$nlist"'
  3407. $run eval "$NM $arg | $global_symbol_pipe >> '$nlist'"
  3408. done
  3409. if test -z "$run"; then
  3410. # Make sure we have at least an empty file.
  3411. test -f "$nlist" || : > "$nlist"
  3412. if test -n "$exclude_expsyms"; then
  3413. egrep -v " ($exclude_expsyms)$" "$nlist" > "$nlist"T
  3414. $mv "$nlist"T "$nlist"
  3415. fi
  3416. # Try sorting and uniquifying the output.
  3417. if grep -v "^: " < "$nlist" | sort +2 | uniq > "$nlist"S; then
  3418. :
  3419. else
  3420. grep -v "^: " < "$nlist" > "$nlist"S
  3421. fi
  3422. if test -f "$nlist"S; then
  3423. eval "$global_symbol_to_cdecl"' < "$nlist"S >> "$output_objdir/$dlsyms"'
  3424. else
  3425. echo '/* NONE */' >> "$output_objdir/$dlsyms"
  3426. fi
  3427. $echo >> "$output_objdir/$dlsyms" "\
  3428. #undef lt_preloaded_symbols
  3429. #if defined (__STDC__) && __STDC__
  3430. # define lt_ptr void *
  3431. #else
  3432. # define lt_ptr char *
  3433. # define const
  3434. #endif
  3435. /* The mapping between symbol names and symbols. */
  3436. const struct {
  3437. const char *name;
  3438. lt_ptr address;
  3439. }
  3440. lt_preloaded_symbols[] =
  3441. {\
  3442. "
  3443. eval "$global_symbol_to_c_name_address" < "$nlist" >> "$output_objdir/$dlsyms"
  3444. $echo >> "$output_objdir/$dlsyms" "\
  3445. {0, (lt_ptr) 0}
  3446. };
  3447. /* This works around a problem in FreeBSD linker */
  3448. #ifdef FREEBSD_WORKAROUND
  3449. static const void *lt_preloaded_setup() {
  3450. return lt_preloaded_symbols;
  3451. }
  3452. #endif
  3453. #ifdef __cplusplus
  3454. }
  3455. #endif\
  3456. "
  3457. fi
  3458. pic_flag_for_symtable=
  3459. case $host in
  3460. # compiling the symbol table file with pic_flag works around
  3461. # a FreeBSD bug that causes programs to crash when -lm is
  3462. # linked before any other PIC object. But we must not use
  3463. # pic_flag when linking with -static. The problem exists in
  3464. # FreeBSD 2.2.6 and is fixed in FreeBSD 3.1.
  3465. *-*-freebsd2*|*-*-freebsd3.0*|*-*-freebsdelf3.0*)
  3466. case "$compile_command " in
  3467. *" -static "*) ;;
  3468. *) pic_flag_for_symtable=" $pic_flag -DFREEBSD_WORKAROUND";;
  3469. esac;;
  3470. *-*-hpux*)
  3471. case "$compile_command " in
  3472. *" -static "*) ;;
  3473. *) pic_flag_for_symtable=" $pic_flag";;
  3474. esac
  3475. esac
  3476. # Now compile the dynamic symbol file.
  3477. $show "(cd $output_objdir && $LTCC -c$no_builtin_flag$pic_flag_for_symtable \"$dlsyms\")"
  3478. $run eval '(cd $output_objdir && $LTCC -c$no_builtin_flag$pic_flag_for_symtable "$dlsyms")' || exit $?
  3479. # Clean up the generated files.
  3480. $show "$rm $output_objdir/$dlsyms $nlist ${nlist}S ${nlist}T"
  3481. $run $rm "$output_objdir/$dlsyms" "$nlist" "${nlist}S" "${nlist}T"
  3482. # Transform the symbol file into the correct name.
  3483. compile_command=`$echo "X$compile_command" | $Xsed -e "s%@SYMFILE@%$output_objdir/${outputname}S.${objext}%"`
  3484. finalize_command=`$echo "X$finalize_command" | $Xsed -e "s%@SYMFILE@%$output_objdir/${outputname}S.${objext}%"`
  3485. ;;
  3486. *)
  3487. $echo "$modename: unknown suffix for \`$dlsyms'" 1>&2
  3488. exit 1
  3489. ;;
  3490. esac
  3491. else
  3492. # We keep going just in case the user didn't refer to
  3493. # lt_preloaded_symbols. The linker will fail if global_symbol_pipe
  3494. # really was required.
  3495. # Nullify the symbol file.
  3496. compile_command=`$echo "X$compile_command" | $Xsed -e "s% @SYMFILE@%%"`
  3497. finalize_command=`$echo "X$finalize_command" | $Xsed -e "s% @SYMFILE@%%"`
  3498. fi
  3499. if test $need_relink = no || test "$build_libtool_libs" != yes; then
  3500. # Replace the output file specification.
  3501. compile_command=`$echo "X$compile_command" | $Xsed -e 's%@OUTPUT@%'"$output"'%g'`
  3502. link_command="$compile_command$compile_rpath"
  3503. # We have no uninstalled library dependencies, so finalize right now.
  3504. $show "$link_command"
  3505. $run eval "$link_command"
  3506. status=$?
  3507. # Delete the generated files.
  3508. if test -n "$dlsyms"; then
  3509. $show "$rm $output_objdir/${outputname}S.${objext}"
  3510. $run $rm "$output_objdir/${outputname}S.${objext}"
  3511. fi
  3512. exit $status
  3513. fi
  3514. if test -n "$shlibpath_var"; then
  3515. # We should set the shlibpath_var
  3516. rpath=
  3517. for dir in $temp_rpath; do
  3518. case $dir in
  3519. [\\/]* | [A-Za-z]:[\\/]*)
  3520. # Absolute path.
  3521. rpath="$rpath$dir:"
  3522. ;;
  3523. *)
  3524. # Relative path: add a thisdir entry.
  3525. rpath="$rpath\$thisdir/$dir:"
  3526. ;;
  3527. esac
  3528. done
  3529. temp_rpath="$rpath"
  3530. fi
  3531. if test -n "$compile_shlibpath$finalize_shlibpath"; then
  3532. compile_command="$shlibpath_var=\"$compile_shlibpath$finalize_shlibpath\$$shlibpath_var\" $compile_command"
  3533. fi
  3534. if test -n "$finalize_shlibpath"; then
  3535. finalize_command="$shlibpath_var=\"$finalize_shlibpath\$$shlibpath_var\" $finalize_command"
  3536. fi
  3537. compile_var=
  3538. finalize_var=
  3539. if test -n "$runpath_var"; then
  3540. if test -n "$perm_rpath"; then
  3541. # We should set the runpath_var.
  3542. rpath=
  3543. for dir in $perm_rpath; do
  3544. rpath="$rpath$dir:"
  3545. done
  3546. compile_var="$runpath_var=\"$rpath\$$runpath_var\" "
  3547. fi
  3548. if test -n "$finalize_perm_rpath"; then
  3549. # We should set the runpath_var.
  3550. rpath=
  3551. for dir in $finalize_perm_rpath; do
  3552. rpath="$rpath$dir:"
  3553. done
  3554. finalize_var="$runpath_var=\"$rpath\$$runpath_var\" "
  3555. fi
  3556. fi
  3557. if test "$no_install" = yes; then
  3558. # We don't need to create a wrapper script.
  3559. link_command="$compile_var$compile_command$compile_rpath"
  3560. # Replace the output file specification.
  3561. link_command=`$echo "X$link_command" | $Xsed -e 's%@OUTPUT@%'"$output"'%g'`
  3562. # Delete the old output file.
  3563. $run $rm $output
  3564. # Link the executable and exit
  3565. $show "$link_command"
  3566. $run eval "$link_command" || exit $?
  3567. exit 0
  3568. fi
  3569. if test "$hardcode_action" = relink; then
  3570. # Fast installation is not supported
  3571. link_command="$compile_var$compile_command$compile_rpath"
  3572. relink_command="$finalize_var$finalize_command$finalize_rpath"
  3573. $echo "$modename: warning: this platform does not like uninstalled shared libraries" 1>&2
  3574. $echo "$modename: \`$output' will be relinked during installation" 1>&2
  3575. else
  3576. if test "$fast_install" != no; then
  3577. link_command="$finalize_var$compile_command$finalize_rpath"
  3578. if test "$fast_install" = yes; then
  3579. relink_command=`$echo "X$compile_var$compile_command$compile_rpath" | $Xsed -e 's%@OUTPUT@%\$progdir/\$file%g'`
  3580. else
  3581. # fast_install is set to needless
  3582. relink_command=
  3583. fi
  3584. else
  3585. link_command="$compile_var$compile_command$compile_rpath"
  3586. relink_command="$finalize_var$finalize_command$finalize_rpath"
  3587. fi
  3588. fi
  3589. # Replace the output file specification.
  3590. link_command=`$echo "X$link_command" | $Xsed -e 's%@OUTPUT@%'"$output_objdir/$outputname"'%g'`
  3591. # Delete the old output files.
  3592. $run $rm $output $output_objdir/$outputname $output_objdir/lt-$outputname
  3593. $show "$link_command"
  3594. $run eval "$link_command" || exit $?
  3595. # Now create the wrapper script.
  3596. $show "creating $output"
  3597. # Quote the relink command for shipping.
  3598. if test -n "$relink_command"; then
  3599. # Preserve any variables that may affect compiler behavior
  3600. for var in $variables_saved_for_relink; do
  3601. if eval test -z \"\${$var+set}\"; then
  3602. relink_command="{ test -z \"\${$var+set}\" || unset $var || { $var=; export $var; }; }; $relink_command"
  3603. elif eval var_value=\$$var; test -z "$var_value"; then
  3604. relink_command="$var=; export $var; $relink_command"
  3605. else
  3606. var_value=`$echo "X$var_value" | $Xsed -e "$sed_quote_subst"`
  3607. relink_command="$var=\"$var_value\"; export $var; $relink_command"
  3608. fi
  3609. done
  3610. relink_command="cd `pwd`; $relink_command"
  3611. relink_command=`$echo "X$relink_command" | $Xsed -e "$sed_quote_subst"`
  3612. fi
  3613. # Quote $echo for shipping.
  3614. if test "X$echo" = "X$SHELL $0 --fallback-echo"; then
  3615. case $0 in
  3616. [\\/]* | [A-Za-z]:[\\/]*) qecho="$SHELL $0 --fallback-echo";;
  3617. *) qecho="$SHELL `pwd`/$0 --fallback-echo";;
  3618. esac
  3619. qecho=`$echo "X$qecho" | $Xsed -e "$sed_quote_subst"`
  3620. else
  3621. qecho=`$echo "X$echo" | $Xsed -e "$sed_quote_subst"`
  3622. fi
  3623. # Only actually do things if our run command is non-null.
  3624. if test -z "$run"; then
  3625. # win32 will think the script is a binary if it has
  3626. # a .exe suffix, so we strip it off here.
  3627. case $output in
  3628. *.exe) output=`echo $output|sed 's,.exe$,,'` ;;
  3629. esac
  3630. # test for cygwin because mv fails w/o .exe extensions
  3631. case $host in
  3632. *cygwin*) exeext=.exe ;;
  3633. *) exeext= ;;
  3634. esac
  3635. $rm $output
  3636. trap "$rm $output; exit 1" 1 2 15
  3637. $echo > $output "\
  3638. #! $SHELL
  3639. # $output - temporary wrapper script for $objdir/$outputname
  3640. # Generated by $PROGRAM - GNU $PACKAGE $VERSION$TIMESTAMP
  3641. #
  3642. # The $output program cannot be directly executed until all the libtool
  3643. # libraries that it depends on are installed.
  3644. #
  3645. # This wrapper script should never be moved out of the build directory.
  3646. # If it is, it will not operate correctly.
  3647. # Sed substitution that helps us do robust quoting. It backslashifies
  3648. # metacharacters that are still active within double-quoted strings.
  3649. Xsed='sed -e 1s/^X//'
  3650. sed_quote_subst='$sed_quote_subst'
  3651. # The HP-UX ksh and POSIX shell print the target directory to stdout
  3652. # if CDPATH is set.
  3653. if test \"\${CDPATH+set}\" = set; then CDPATH=:; export CDPATH; fi
  3654. relink_command=\"$relink_command\"
  3655. # This environment variable determines our operation mode.
  3656. if test \"\$libtool_install_magic\" = \"$magic\"; then
  3657. # install mode needs the following variable:
  3658. notinst_deplibs='$notinst_deplibs'
  3659. else
  3660. # When we are sourced in execute mode, \$file and \$echo are already set.
  3661. if test \"\$libtool_execute_magic\" != \"$magic\"; then
  3662. echo=\"$qecho\"
  3663. file=\"\$0\"
  3664. # Make sure echo works.
  3665. if test \"X\$1\" = X--no-reexec; then
  3666. # Discard the --no-reexec flag, and continue.
  3667. shift
  3668. elif test \"X\`(\$echo '\t') 2>/dev/null\`\" = 'X\t'; then
  3669. # Yippee, \$echo works!
  3670. :
  3671. else
  3672. # Restart under the correct shell, and then maybe \$echo will work.
  3673. exec $SHELL \"\$0\" --no-reexec \${1+\"\$@\"}
  3674. fi
  3675. fi\
  3676. "
  3677. $echo >> $output "\
  3678. # Find the directory that this script lives in.
  3679. thisdir=\`\$echo \"X\$file\" | \$Xsed -e 's%/[^/]*$%%'\`
  3680. test \"x\$thisdir\" = \"x\$file\" && thisdir=.
  3681. # Follow symbolic links until we get to the real thisdir.
  3682. file=\`ls -ld \"\$file\" | sed -n 's/.*-> //p'\`
  3683. while test -n \"\$file\"; do
  3684. destdir=\`\$echo \"X\$file\" | \$Xsed -e 's%/[^/]*\$%%'\`
  3685. # If there was a directory component, then change thisdir.
  3686. if test \"x\$destdir\" != \"x\$file\"; then
  3687. case \"\$destdir\" in
  3688. [\\\\/]* | [A-Za-z]:[\\\\/]*) thisdir=\"\$destdir\" ;;
  3689. *) thisdir=\"\$thisdir/\$destdir\" ;;
  3690. esac
  3691. fi
  3692. file=\`\$echo \"X\$file\" | \$Xsed -e 's%^.*/%%'\`
  3693. file=\`ls -ld \"\$thisdir/\$file\" | sed -n 's/.*-> //p'\`
  3694. done
  3695. # Try to get the absolute directory name.
  3696. absdir=\`cd \"\$thisdir\" && pwd\`
  3697. test -n \"\$absdir\" && thisdir=\"\$absdir\"
  3698. "
  3699. if test "$fast_install" = yes; then
  3700. echo >> $output "\
  3701. program=lt-'$outputname'$exeext
  3702. progdir=\"\$thisdir/$objdir\"
  3703. if test ! -f \"\$progdir/\$program\" || \\
  3704. { file=\`ls -1dt \"\$progdir/\$program\" \"\$progdir/../\$program\" 2>/dev/null | sed 1q\`; \\
  3705. test \"X\$file\" != \"X\$progdir/\$program\"; }; then
  3706. file=\"\$\$-\$program\"
  3707. if test ! -d \"\$progdir\"; then
  3708. $mkdir \"\$progdir\"
  3709. else
  3710. $rm \"\$progdir/\$file\"
  3711. fi"
  3712. echo >> $output "\
  3713. # relink executable if necessary
  3714. if test -n \"\$relink_command\"; then
  3715. if relink_command_output=\`eval \$relink_command 2>&1\`; then :
  3716. else
  3717. $echo \"\$relink_command_output\" >&2
  3718. $rm \"\$progdir/\$file\"
  3719. exit 1
  3720. fi
  3721. fi
  3722. $mv \"\$progdir/\$file\" \"\$progdir/\$program\" 2>/dev/null ||
  3723. { $rm \"\$progdir/\$program\";
  3724. $mv \"\$progdir/\$file\" \"\$progdir/\$program\"; }
  3725. $rm \"\$progdir/\$file\"
  3726. fi"
  3727. else
  3728. echo >> $output "\
  3729. program='$outputname'
  3730. progdir=\"\$thisdir/$objdir\"
  3731. "
  3732. fi
  3733. echo >> $output "\
  3734. if test -f \"\$progdir/\$program\"; then"
  3735. # Export our shlibpath_var if we have one.
  3736. if test "$shlibpath_overrides_runpath" = yes && test -n "$shlibpath_var" && test -n "$temp_rpath"; then
  3737. $echo >> $output "\
  3738. # Add our own library path to $shlibpath_var
  3739. $shlibpath_var=\"$temp_rpath\$$shlibpath_var\"
  3740. # Some systems cannot cope with colon-terminated $shlibpath_var
  3741. # The second colon is a workaround for a bug in BeOS R4 sed
  3742. $shlibpath_var=\`\$echo \"X\$$shlibpath_var\" | \$Xsed -e 's/::*\$//'\`
  3743. export $shlibpath_var
  3744. "
  3745. fi
  3746. # fixup the dll searchpath if we need to.
  3747. if test -n "$dllsearchpath"; then
  3748. $echo >> $output "\
  3749. # Add the dll search path components to the executable PATH
  3750. PATH=$dllsearchpath:\$PATH
  3751. "
  3752. fi
  3753. $echo >> $output "\
  3754. if test \"\$libtool_execute_magic\" != \"$magic\"; then
  3755. # Run the actual program with our arguments.
  3756. "
  3757. case $host in
  3758. # win32 systems need to use the prog path for dll
  3759. # lookup to work
  3760. *-*-cygwin* | *-*-pw32*)
  3761. $echo >> $output "\
  3762. exec \$progdir/\$program \${1+\"\$@\"}
  3763. "
  3764. ;;
  3765. # Backslashes separate directories on plain windows
  3766. *-*-mingw | *-*-os2*)
  3767. $echo >> $output "\
  3768. exec \$progdir\\\\\$program \${1+\"\$@\"}
  3769. "
  3770. ;;
  3771. *)
  3772. $echo >> $output "\
  3773. # Export the path to the program.
  3774. PATH=\"\$progdir:\$PATH\"
  3775. export PATH
  3776. exec \$program \${1+\"\$@\"}
  3777. "
  3778. ;;
  3779. esac
  3780. $echo >> $output "\
  3781. \$echo \"\$0: cannot exec \$program \${1+\"\$@\"}\"
  3782. exit 1
  3783. fi
  3784. else
  3785. # The program doesn't exist.
  3786. \$echo \"\$0: error: \$progdir/\$program does not exist\" 1>&2
  3787. \$echo \"This script is just a wrapper for \$program.\" 1>&2
  3788. echo \"See the $PACKAGE documentation for more information.\" 1>&2
  3789. exit 1
  3790. fi
  3791. fi\
  3792. "
  3793. chmod +x $output
  3794. fi
  3795. exit 0
  3796. ;;
  3797. esac
  3798. # See if we need to build an old-fashioned archive.
  3799. for oldlib in $oldlibs; do
  3800. if test "$build_libtool_libs" = convenience; then
  3801. oldobjs="$libobjs_save"
  3802. addlibs="$convenience"
  3803. build_libtool_libs=no
  3804. else
  3805. if test "$build_libtool_libs" = module; then
  3806. oldobjs="$libobjs_save"
  3807. build_libtool_libs=no
  3808. else
  3809. oldobjs="$objs$old_deplibs $non_pic_objects"
  3810. fi
  3811. addlibs="$old_convenience"
  3812. fi
  3813. if test -n "$addlibs"; then
  3814. gentop="$output_objdir/${outputname}x"
  3815. $show "${rm}r $gentop"
  3816. $run ${rm}r "$gentop"
  3817. $show "$mkdir $gentop"
  3818. $run $mkdir "$gentop"
  3819. status=$?
  3820. if test $status -ne 0 && test ! -d "$gentop"; then
  3821. exit $status
  3822. fi
  3823. generated="$generated $gentop"
  3824. # Add in members from convenience archives.
  3825. for xlib in $addlibs; do
  3826. # Extract the objects.
  3827. case $xlib in
  3828. [\\/]* | [A-Za-z]:[\\/]*) xabs="$xlib" ;;
  3829. *) xabs=`pwd`"/$xlib" ;;
  3830. esac
  3831. xlib=`$echo "X$xlib" | $Xsed -e 's%^.*/%%'`
  3832. xdir="$gentop/$xlib"
  3833. $show "${rm}r $xdir"
  3834. $run ${rm}r "$xdir"
  3835. $show "$mkdir $xdir"
  3836. $run $mkdir "$xdir"
  3837. status=$?
  3838. if test $status -ne 0 && test ! -d "$xdir"; then
  3839. exit $status
  3840. fi
  3841. $show "(cd $xdir && $AR x $xabs)"
  3842. $run eval "(cd \$xdir && $AR x \$xabs)" || exit $?
  3843. oldobjs="$oldobjs "`find $xdir -name \*.${objext} -print -o -name \*.lo -print | $NL2SP`
  3844. done
  3845. fi
  3846. # Do each command in the archive commands.
  3847. if test -n "$old_archive_from_new_cmds" && test "$build_libtool_libs" = yes; then
  3848. eval cmds=\"$old_archive_from_new_cmds\"
  3849. else
  3850. eval cmds=\"$old_archive_cmds\"
  3851. if len=`expr "X$cmds" : ".*"` &&
  3852. test $len -le $max_cmd_len || test $max_cmd_len -le -1; then
  3853. :
  3854. else
  3855. # the command line is too long to link in one step, link in parts
  3856. $echo "using piecewise archive linking..."
  3857. save_RANLIB=$RANLIB
  3858. RANLIB=:
  3859. objlist=
  3860. concat_cmds=
  3861. save_oldobjs=$oldobjs
  3862. for obj in $save_oldobjs
  3863. do
  3864. oldobjs="$objlist $obj"
  3865. objlist="$objlist $obj"
  3866. eval test_cmds=\"$old_archive_cmds\"
  3867. if len=`expr "X$test_cmds" : ".*"` &&
  3868. test $len -le $max_cmd_len; then
  3869. :
  3870. else
  3871. # the above command should be used before it gets too long
  3872. oldobjs=$objlist
  3873. test -z "$concat_cmds" || concat_cmds=$concat_cmds~
  3874. eval concat_cmds=\"\${concat_cmds}$old_archive_cmds\"
  3875. objlist=
  3876. fi
  3877. done
  3878. RANLIB=$save_RANLIB
  3879. oldobjs=$objlist
  3880. eval cmds=\"\$concat_cmds~$old_archive_cmds\"
  3881. fi
  3882. fi
  3883. IFS="${IFS= }"; save_ifs="$IFS"; IFS='~'
  3884. for cmd in $cmds; do
  3885. IFS="$save_ifs"
  3886. $show "$cmd"
  3887. $run eval "$cmd" || exit $?
  3888. done
  3889. IFS="$save_ifs"
  3890. done
  3891. if test -n "$generated"; then
  3892. $show "${rm}r$generated"
  3893. $run ${rm}r$generated
  3894. fi
  3895. # Now create the libtool archive.
  3896. case $output in
  3897. *.la)
  3898. old_library=
  3899. test "$build_old_libs" = yes && old_library="$libname.$libext"
  3900. $show "creating $output"
  3901. # Preserve any variables that may affect compiler behavior
  3902. for var in $variables_saved_for_relink; do
  3903. if eval test -z \"\${$var+set}\"; then
  3904. relink_command="{ test -z \"\${$var+set}\" || unset $var || { $var=; export $var; }; }; $relink_command"
  3905. elif eval var_value=\$$var; test -z "$var_value"; then
  3906. relink_command="$var=; export $var; $relink_command"
  3907. else
  3908. var_value=`$echo "X$var_value" | $Xsed -e "$sed_quote_subst"`
  3909. relink_command="$var=\"$var_value\"; export $var; $relink_command"
  3910. fi
  3911. done
  3912. # Quote the link command for shipping.
  3913. relink_command="cd `pwd`; $SHELL $0 --mode=relink $libtool_args"
  3914. relink_command=`$echo "X$relink_command" | $Xsed -e "$sed_quote_subst"`
  3915. # Only create the output if not a dry run.
  3916. if test -z "$run"; then
  3917. for installed in no yes; do
  3918. if test "$installed" = yes; then
  3919. if test -z "$install_libdir"; then
  3920. break
  3921. fi
  3922. output="$output_objdir/$outputname"i
  3923. # Replace all uninstalled libtool libraries with the installed ones
  3924. newdependency_libs=
  3925. for deplib in $dependency_libs; do
  3926. case $deplib in
  3927. *.la)
  3928. name=`$echo "X$deplib" | $Xsed -e 's%^.*/%%'`
  3929. eval libdir=`sed -n -e 's/^libdir=\(.*\)$/\1/p' $deplib`
  3930. if test -z "$libdir"; then
  3931. $echo "$modename: \`$deplib' is not a valid libtool archive" 1>&2
  3932. exit 1
  3933. fi
  3934. newdependency_libs="$newdependency_libs $libdir/$name"
  3935. ;;
  3936. *) newdependency_libs="$newdependency_libs $deplib" ;;
  3937. esac
  3938. done
  3939. dependency_libs="$newdependency_libs"
  3940. newdlfiles=
  3941. for lib in $dlfiles; do
  3942. name=`$echo "X$lib" | $Xsed -e 's%^.*/%%'`
  3943. eval libdir=`sed -n -e 's/^libdir=\(.*\)$/\1/p' $lib`
  3944. if test -z "$libdir"; then
  3945. $echo "$modename: \`$lib' is not a valid libtool archive" 1>&2
  3946. exit 1
  3947. fi
  3948. newdlfiles="$newdlfiles $libdir/$name"
  3949. done
  3950. dlfiles="$newdlfiles"
  3951. newdlprefiles=
  3952. for lib in $dlprefiles; do
  3953. name=`$echo "X$lib" | $Xsed -e 's%^.*/%%'`
  3954. eval libdir=`sed -n -e 's/^libdir=\(.*\)$/\1/p' $lib`
  3955. if test -z "$libdir"; then
  3956. $echo "$modename: \`$lib' is not a valid libtool archive" 1>&2
  3957. exit 1
  3958. fi
  3959. newdlprefiles="$newdlprefiles $libdir/$name"
  3960. done
  3961. dlprefiles="$newdlprefiles"
  3962. fi
  3963. $rm $output
  3964. # place dlname in correct position for cygwin
  3965. tdlname=$dlname
  3966. case $host,$output,$installed,$module,$dlname in
  3967. *cygwin*,*lai,yes,no,*.dll) tdlname=../bin/$dlname ;;
  3968. esac
  3969. $echo > $output "\
  3970. # $outputname - a libtool library file
  3971. # Generated by $PROGRAM - GNU $PACKAGE $VERSION$TIMESTAMP
  3972. #
  3973. # Please DO NOT delete this file!
  3974. # It is necessary for linking the library.
  3975. # The name that we can dlopen(3).
  3976. dlname='$tdlname'
  3977. # Names of this library.
  3978. library_names='$library_names'
  3979. # The name of the static archive.
  3980. old_library='$old_library'
  3981. # Libraries that this one depends upon.
  3982. dependency_libs='$dependency_libs'
  3983. # Version information for $libname.
  3984. current=$current
  3985. age=$age
  3986. revision=$revision
  3987. # Is this an already installed library?
  3988. installed=$installed
  3989. # Files to dlopen/dlpreopen
  3990. dlopen='$dlfiles'
  3991. dlpreopen='$dlprefiles'
  3992. # Directory that this library needs to be installed in:
  3993. libdir='$install_libdir'"
  3994. if test "$installed" = no && test $need_relink = yes; then
  3995. $echo >> $output "\
  3996. relink_command=\"$relink_command\""
  3997. fi
  3998. done
  3999. fi
  4000. # Do a symbolic link so that the libtool archive can be found in
  4001. # LD_LIBRARY_PATH before the program is installed.
  4002. $show "(cd $output_objdir && $rm $outputname && $LN_S ../$outputname $outputname)"
  4003. $run eval '(cd $output_objdir && $rm $outputname && $LN_S ../$outputname $outputname)' || exit $?
  4004. ;;
  4005. esac
  4006. exit 0
  4007. ;;
  4008. # libtool install mode
  4009. install)
  4010. modename="$modename: install"
  4011. # There may be an optional sh(1) argument at the beginning of
  4012. # install_prog (especially on Windows NT).
  4013. if test "$nonopt" = "$SHELL" || test "$nonopt" = /bin/sh ||
  4014. # Allow the use of GNU shtool's install command.
  4015. $echo "X$nonopt" | $Xsed | grep shtool > /dev/null; then
  4016. # Aesthetically quote it.
  4017. arg=`$echo "X$nonopt" | $Xsed -e "$sed_quote_subst"`
  4018. case $arg in
  4019. *[\[\~\#\^\&\*\(\)\{\}\|\;\<\>\?\'\ \ ]*|*]*)
  4020. arg="\"$arg\""
  4021. ;;
  4022. esac
  4023. install_prog="$arg "
  4024. arg="$1"
  4025. shift
  4026. else
  4027. install_prog=
  4028. arg="$nonopt"
  4029. fi
  4030. # The real first argument should be the name of the installation program.
  4031. # Aesthetically quote it.
  4032. arg=`$echo "X$arg" | $Xsed -e "$sed_quote_subst"`
  4033. case $arg in
  4034. *[\[\~\#\^\&\*\(\)\{\}\|\;\<\>\?\'\ \ ]*|*]*)
  4035. arg="\"$arg\""
  4036. ;;
  4037. esac
  4038. install_prog="$install_prog$arg"
  4039. # We need to accept at least all the BSD install flags.
  4040. dest=
  4041. files=
  4042. opts=
  4043. prev=
  4044. install_type=
  4045. isdir=no
  4046. stripme=
  4047. for arg
  4048. do
  4049. if test -n "$dest"; then
  4050. files="$files $dest"
  4051. dest="$arg"
  4052. continue
  4053. fi
  4054. case $arg in
  4055. -d) isdir=yes ;;
  4056. -f) prev="-f" ;;
  4057. -g) prev="-g" ;;
  4058. -m) prev="-m" ;;
  4059. -o) prev="-o" ;;
  4060. -s)
  4061. stripme=" -s"
  4062. continue
  4063. ;;
  4064. -*) ;;
  4065. *)
  4066. # If the previous option needed an argument, then skip it.
  4067. if test -n "$prev"; then
  4068. prev=
  4069. else
  4070. dest="$arg"
  4071. continue
  4072. fi
  4073. ;;
  4074. esac
  4075. # Aesthetically quote the argument.
  4076. arg=`$echo "X$arg" | $Xsed -e "$sed_quote_subst"`
  4077. case $arg in
  4078. *[\[\~\#\^\&\*\(\)\{\}\|\;\<\>\?\'\ \ ]*|*]*)
  4079. arg="\"$arg\""
  4080. ;;
  4081. esac
  4082. install_prog="$install_prog $arg"
  4083. done
  4084. if test -z "$install_prog"; then
  4085. $echo "$modename: you must specify an install program" 1>&2
  4086. $echo "$help" 1>&2
  4087. exit 1
  4088. fi
  4089. if test -n "$prev"; then
  4090. $echo "$modename: the \`$prev' option requires an argument" 1>&2
  4091. $echo "$help" 1>&2
  4092. exit 1
  4093. fi
  4094. if test -z "$files"; then
  4095. if test -z "$dest"; then
  4096. $echo "$modename: no file or destination specified" 1>&2
  4097. else
  4098. $echo "$modename: you must specify a destination" 1>&2
  4099. fi
  4100. $echo "$help" 1>&2
  4101. exit 1
  4102. fi
  4103. # Strip any trailing slash from the destination.
  4104. dest=`$echo "X$dest" | $Xsed -e 's%/$%%'`
  4105. # Check to see that the destination is a directory.
  4106. test -d "$dest" && isdir=yes
  4107. if test "$isdir" = yes; then
  4108. destdir="$dest"
  4109. destname=
  4110. else
  4111. destdir=`$echo "X$dest" | $Xsed -e 's%/[^/]*$%%'`
  4112. test "X$destdir" = "X$dest" && destdir=.
  4113. destname=`$echo "X$dest" | $Xsed -e 's%^.*/%%'`
  4114. # Not a directory, so check to see that there is only one file specified.
  4115. set dummy $files
  4116. if test $# -gt 2; then
  4117. $echo "$modename: \`$dest' is not a directory" 1>&2
  4118. $echo "$help" 1>&2
  4119. exit 1
  4120. fi
  4121. fi
  4122. case $destdir in
  4123. [\\/]* | [A-Za-z]:[\\/]*) ;;
  4124. *)
  4125. for file in $files; do
  4126. case $file in
  4127. *.lo) ;;
  4128. *)
  4129. $echo "$modename: \`$destdir' must be an absolute directory name" 1>&2
  4130. $echo "$help" 1>&2
  4131. exit 1
  4132. ;;
  4133. esac
  4134. done
  4135. ;;
  4136. esac
  4137. # This variable tells wrapper scripts just to set variables rather
  4138. # than running their programs.
  4139. libtool_install_magic="$magic"
  4140. staticlibs=
  4141. future_libdirs=
  4142. current_libdirs=
  4143. for file in $files; do
  4144. # Do each installation.
  4145. case $file in
  4146. *.$libext)
  4147. # Do the static libraries later.
  4148. staticlibs="$staticlibs $file"
  4149. ;;
  4150. *.la)
  4151. # Check to see that this really is a libtool archive.
  4152. if (sed -e '2q' $file | egrep "^# Generated by .*$PACKAGE") >/dev/null 2>&1; then :
  4153. else
  4154. $echo "$modename: \`$file' is not a valid libtool archive" 1>&2
  4155. $echo "$help" 1>&2
  4156. exit 1
  4157. fi
  4158. library_names=
  4159. old_library=
  4160. relink_command=
  4161. # If there is no directory component, then add one.
  4162. case $file in
  4163. */* | *\\*) . $file ;;
  4164. *) . ./$file ;;
  4165. esac
  4166. # Add the libdir to current_libdirs if it is the destination.
  4167. if test "X$destdir" = "X$libdir"; then
  4168. case "$current_libdirs " in
  4169. *" $libdir "*) ;;
  4170. *) current_libdirs="$current_libdirs $libdir" ;;
  4171. esac
  4172. else
  4173. # Note the libdir as a future libdir.
  4174. case "$future_libdirs " in
  4175. *" $libdir "*) ;;
  4176. *) future_libdirs="$future_libdirs $libdir" ;;
  4177. esac
  4178. fi
  4179. dir=`$echo "X$file" | $Xsed -e 's%/[^/]*$%%'`/
  4180. test "X$dir" = "X$file/" && dir=
  4181. dir="$dir$objdir"
  4182. if test -n "$relink_command"; then
  4183. $echo "$modename: warning: relinking \`$file'" 1>&2
  4184. $show "$relink_command"
  4185. if $run eval "$relink_command"; then :
  4186. else
  4187. $echo "$modename: error: relink \`$file' with the above command before installing it" 1>&2
  4188. continue
  4189. fi
  4190. fi
  4191. # See the names of the shared library.
  4192. set dummy $library_names
  4193. if test -n "$2"; then
  4194. realname="$2"
  4195. shift
  4196. shift
  4197. srcname="$realname"
  4198. test -n "$relink_command" && srcname="$realname"T
  4199. # Install the shared library and build the symlinks.
  4200. $show "$install_prog $dir/$srcname $destdir/$realname"
  4201. $run eval "$install_prog $dir/$srcname $destdir/$realname" || exit $?
  4202. if test -n "$stripme" && test -n "$striplib"; then
  4203. $show "$striplib $destdir/$realname"
  4204. $run eval "$striplib $destdir/$realname" || exit $?
  4205. fi
  4206. if test $# -gt 0; then
  4207. # Delete the old symlinks, and create new ones.
  4208. for linkname
  4209. do
  4210. if test "$linkname" != "$realname"; then
  4211. $show "(cd $destdir && $rm $linkname && $LN_S $realname $linkname)"
  4212. $run eval "(cd $destdir && $rm $linkname && $LN_S $realname $linkname)"
  4213. fi
  4214. done
  4215. fi
  4216. # Do each command in the postinstall commands.
  4217. lib="$destdir/$realname"
  4218. eval cmds=\"$postinstall_cmds\"
  4219. IFS="${IFS= }"; save_ifs="$IFS"; IFS='~'
  4220. for cmd in $cmds; do
  4221. IFS="$save_ifs"
  4222. $show "$cmd"
  4223. $run eval "$cmd" || exit $?
  4224. done
  4225. IFS="$save_ifs"
  4226. fi
  4227. # Install the pseudo-library for information purposes.
  4228. name=`$echo "X$file" | $Xsed -e 's%^.*/%%'`
  4229. instname="$dir/$name"i
  4230. $show "$install_prog $instname $destdir/$name"
  4231. $run eval "$install_prog $instname $destdir/$name" || exit $?
  4232. # Maybe install the static library, too.
  4233. test -n "$old_library" && staticlibs="$staticlibs $dir/$old_library"
  4234. ;;
  4235. *.lo)
  4236. # Install (i.e. copy) a libtool object.
  4237. # Figure out destination file name, if it wasn't already specified.
  4238. if test -n "$destname"; then
  4239. destfile="$destdir/$destname"
  4240. else
  4241. destfile=`$echo "X$file" | $Xsed -e 's%^.*/%%'`
  4242. destfile="$destdir/$destfile"
  4243. fi
  4244. # Deduce the name of the destination old-style object file.
  4245. case $destfile in
  4246. *.lo)
  4247. staticdest=`$echo "X$destfile" | $Xsed -e "$lo2o"`
  4248. ;;
  4249. *.$objext)
  4250. staticdest="$destfile"
  4251. destfile=
  4252. ;;
  4253. *)
  4254. $echo "$modename: cannot copy a libtool object to \`$destfile'" 1>&2
  4255. $echo "$help" 1>&2
  4256. exit 1
  4257. ;;
  4258. esac
  4259. # Install the libtool object if requested.
  4260. if test -n "$destfile"; then
  4261. $show "$install_prog $file $destfile"
  4262. $run eval "$install_prog $file $destfile" || exit $?
  4263. fi
  4264. # Install the old object if enabled.
  4265. if test "$build_old_libs" = yes; then
  4266. # Deduce the name of the old-style object file.
  4267. staticobj=`$echo "X$file" | $Xsed -e "$lo2o"`
  4268. $show "$install_prog $staticobj $staticdest"
  4269. $run eval "$install_prog \$staticobj \$staticdest" || exit $?
  4270. fi
  4271. exit 0
  4272. ;;
  4273. *)
  4274. # Figure out destination file name, if it wasn't already specified.
  4275. if test -n "$destname"; then
  4276. destfile="$destdir/$destname"
  4277. else
  4278. destfile=`$echo "X$file" | $Xsed -e 's%^.*/%%'`
  4279. destfile="$destdir/$destfile"
  4280. fi
  4281. # Do a test to see if this is really a libtool program.
  4282. if (sed -e '4q' $file | egrep "^# Generated by .*$PACKAGE") >/dev/null 2>&1; then
  4283. notinst_deplibs=
  4284. relink_command=
  4285. # If there is no directory component, then add one.
  4286. case $file in
  4287. */* | *\\*) . $file ;;
  4288. *) . ./$file ;;
  4289. esac
  4290. # Check the variables that should have been set.
  4291. if test -z "$notinst_deplibs"; then
  4292. $echo "$modename: invalid libtool wrapper script \`$file'" 1>&2
  4293. exit 1
  4294. fi
  4295. finalize=yes
  4296. for lib in $notinst_deplibs; do
  4297. # Check to see that each library is installed.
  4298. libdir=
  4299. if test -f "$lib"; then
  4300. # If there is no directory component, then add one.
  4301. case $lib in
  4302. */* | *\\*) . $lib ;;
  4303. *) . ./$lib ;;
  4304. esac
  4305. fi
  4306. libfile="$libdir/"`$echo "X$lib" | $Xsed -e 's%^.*/%%g'` ### testsuite: skip nested quoting test
  4307. if test -n "$libdir" && test ! -f "$libfile"; then
  4308. $echo "$modename: warning: \`$lib' has not been installed in \`$libdir'" 1>&2
  4309. finalize=no
  4310. fi
  4311. done
  4312. relink_command=
  4313. # If there is no directory component, then add one.
  4314. case $file in
  4315. */* | *\\*) . $file ;;
  4316. *) . ./$file ;;
  4317. esac
  4318. outputname=
  4319. if test "$fast_install" = no && test -n "$relink_command"; then
  4320. if test "$finalize" = yes && test -z "$run"; then
  4321. tmpdir="/tmp"
  4322. test -n "$TMPDIR" && tmpdir="$TMPDIR"
  4323. tmpdir="$tmpdir/libtool-$$"
  4324. if $mkdir -p "$tmpdir" && chmod 700 "$tmpdir"; then :
  4325. else
  4326. $echo "$modename: error: cannot create temporary directory \`$tmpdir'" 1>&2
  4327. continue
  4328. fi
  4329. file=`$echo "X$file" | $Xsed -e 's%^.*/%%'`
  4330. outputname="$tmpdir/$file"
  4331. # Replace the output file specification.
  4332. relink_command=`$echo "X$relink_command" | $Xsed -e 's%@OUTPUT@%'"$outputname"'%g'`
  4333. $show "$relink_command"
  4334. if $run eval "$relink_command"; then :
  4335. else
  4336. $echo "$modename: error: relink \`$file' with the above command before installing it" 1>&2
  4337. ${rm}r "$tmpdir"
  4338. continue
  4339. fi
  4340. file="$outputname"
  4341. else
  4342. $echo "$modename: warning: cannot relink \`$file'" 1>&2
  4343. fi
  4344. else
  4345. # Install the binary that we compiled earlier.
  4346. file=`$echo "X$file" | $Xsed -e "s%\([^/]*\)$%$objdir/\1%"`
  4347. fi
  4348. fi
  4349. # remove .exe since cygwin /usr/bin/install will append another
  4350. # one anyways
  4351. case $install_prog,$host in
  4352. */usr/bin/install*,*cygwin*)
  4353. case $file:$destfile in
  4354. *.exe:*.exe)
  4355. # this is ok
  4356. ;;
  4357. *.exe:*)
  4358. destfile=$destfile.exe
  4359. ;;
  4360. *:*.exe)
  4361. destfile=`echo $destfile | sed -e 's,.exe$,,'`
  4362. ;;
  4363. esac
  4364. ;;
  4365. esac
  4366. $show "$install_prog$stripme $file $destfile"
  4367. $run eval "$install_prog\$stripme \$file \$destfile" || exit $?
  4368. test -n "$outputname" && ${rm}r "$tmpdir"
  4369. ;;
  4370. esac
  4371. done
  4372. for file in $staticlibs; do
  4373. name=`$echo "X$file" | $Xsed -e 's%^.*/%%'`
  4374. # Set up the ranlib parameters.
  4375. oldlib="$destdir/$name"
  4376. $show "$install_prog $file $oldlib"
  4377. $run eval "$install_prog \$file \$oldlib" || exit $?
  4378. if test -n "$stripme" && test -n "$striplib"; then
  4379. $show "$old_striplib $oldlib"
  4380. $run eval "$old_striplib $oldlib" || exit $?
  4381. fi
  4382. # Do each command in the postinstall commands.
  4383. eval cmds=\"$old_postinstall_cmds\"
  4384. IFS="${IFS= }"; save_ifs="$IFS"; IFS='~'
  4385. for cmd in $cmds; do
  4386. IFS="$save_ifs"
  4387. $show "$cmd"
  4388. $run eval "$cmd" || exit $?
  4389. done
  4390. IFS="$save_ifs"
  4391. done
  4392. if test -n "$future_libdirs"; then
  4393. $echo "$modename: warning: remember to run \`$progname --finish$future_libdirs'" 1>&2
  4394. fi
  4395. if test -n "$current_libdirs"; then
  4396. # Maybe just do a dry run.
  4397. test -n "$run" && current_libdirs=" -n$current_libdirs"
  4398. exec_cmd='$SHELL $0 --finish$current_libdirs'
  4399. else
  4400. exit 0
  4401. fi
  4402. ;;
  4403. # libtool finish mode
  4404. finish)
  4405. modename="$modename: finish"
  4406. libdirs="$nonopt"
  4407. admincmds=
  4408. if test -n "$finish_cmds$finish_eval" && test -n "$libdirs"; then
  4409. for dir
  4410. do
  4411. libdirs="$libdirs $dir"
  4412. done
  4413. for libdir in $libdirs; do
  4414. if test -n "$finish_cmds"; then
  4415. # Do each command in the finish commands.
  4416. eval cmds=\"$finish_cmds\"
  4417. IFS="${IFS= }"; save_ifs="$IFS"; IFS='~'
  4418. for cmd in $cmds; do
  4419. IFS="$save_ifs"
  4420. $show "$cmd"
  4421. $run eval "$cmd" || admincmds="$admincmds
  4422. $cmd"
  4423. done
  4424. IFS="$save_ifs"
  4425. fi
  4426. if test -n "$finish_eval"; then
  4427. # Do the single finish_eval.
  4428. eval cmds=\"$finish_eval\"
  4429. $run eval "$cmds" || admincmds="$admincmds
  4430. $cmds"
  4431. fi
  4432. done
  4433. fi
  4434. # Exit here if they wanted silent mode.
  4435. test "$show" = : && exit 0
  4436. echo "----------------------------------------------------------------------"
  4437. echo "Libraries have been installed in:"
  4438. for libdir in $libdirs; do
  4439. echo " $libdir"
  4440. done
  4441. echo
  4442. echo "If you ever happen to want to link against installed libraries"
  4443. echo "in a given directory, LIBDIR, you must either use libtool, and"
  4444. echo "specify the full pathname of the library, or use the \`-LLIBDIR'"
  4445. echo "flag during linking and do at least one of the following:"
  4446. if test -n "$shlibpath_var"; then
  4447. echo " - add LIBDIR to the \`$shlibpath_var' environment variable"
  4448. echo " during execution"
  4449. fi
  4450. if test -n "$runpath_var"; then
  4451. echo " - add LIBDIR to the \`$runpath_var' environment variable"
  4452. echo " during linking"
  4453. fi
  4454. if test -n "$hardcode_libdir_flag_spec"; then
  4455. libdir=LIBDIR
  4456. eval flag=\"$hardcode_libdir_flag_spec\"
  4457. echo " - use the \`$flag' linker flag"
  4458. fi
  4459. if test -n "$admincmds"; then
  4460. echo " - have your system administrator run these commands:$admincmds"
  4461. fi
  4462. if test -f /etc/ld.so.conf; then
  4463. echo " - have your system administrator add LIBDIR to \`/etc/ld.so.conf'"
  4464. fi
  4465. echo
  4466. echo "See any operating system documentation about shared libraries for"
  4467. echo "more information, such as the ld(1) and ld.so(8) manual pages."
  4468. echo "----------------------------------------------------------------------"
  4469. exit 0
  4470. ;;
  4471. # libtool execute mode
  4472. execute)
  4473. modename="$modename: execute"
  4474. # The first argument is the command name.
  4475. cmd="$nonopt"
  4476. if test -z "$cmd"; then
  4477. $echo "$modename: you must specify a COMMAND" 1>&2
  4478. $echo "$help"
  4479. exit 1
  4480. fi
  4481. # Handle -dlopen flags immediately.
  4482. for file in $execute_dlfiles; do
  4483. if test ! -f "$file"; then
  4484. $echo "$modename: \`$file' is not a file" 1>&2
  4485. $echo "$help" 1>&2
  4486. exit 1
  4487. fi
  4488. dir=
  4489. case $file in
  4490. *.la)
  4491. # Check to see that this really is a libtool archive.
  4492. if (sed -e '2q' $file | egrep "^# Generated by .*$PACKAGE") >/dev/null 2>&1; then :
  4493. else
  4494. $echo "$modename: \`$lib' is not a valid libtool archive" 1>&2
  4495. $echo "$help" 1>&2
  4496. exit 1
  4497. fi
  4498. # Read the libtool library.
  4499. dlname=
  4500. library_names=
  4501. # If there is no directory component, then add one.
  4502. case $file in
  4503. */* | *\\*) . $file ;;
  4504. *) . ./$file ;;
  4505. esac
  4506. # Skip this library if it cannot be dlopened.
  4507. if test -z "$dlname"; then
  4508. # Warn if it was a shared library.
  4509. test -n "$library_names" && $echo "$modename: warning: \`$file' was not linked with \`-export-dynamic'"
  4510. continue
  4511. fi
  4512. dir=`$echo "X$file" | $Xsed -e 's%/[^/]*$%%'`
  4513. test "X$dir" = "X$file" && dir=.
  4514. if test -f "$dir/$objdir/$dlname"; then
  4515. dir="$dir/$objdir"
  4516. else
  4517. $echo "$modename: cannot find \`$dlname' in \`$dir' or \`$dir/$objdir'" 1>&2
  4518. exit 1
  4519. fi
  4520. ;;
  4521. *.lo)
  4522. # Just add the directory containing the .lo file.
  4523. dir=`$echo "X$file" | $Xsed -e 's%/[^/]*$%%'`
  4524. test "X$dir" = "X$file" && dir=.
  4525. ;;
  4526. *)
  4527. $echo "$modename: warning \`-dlopen' is ignored for non-libtool libraries and objects" 1>&2
  4528. continue
  4529. ;;
  4530. esac
  4531. # Get the absolute pathname.
  4532. absdir=`cd "$dir" && pwd`
  4533. test -n "$absdir" && dir="$absdir"
  4534. # Now add the directory to shlibpath_var.
  4535. if eval "test -z \"\$$shlibpath_var\""; then
  4536. eval "$shlibpath_var=\"\$dir\""
  4537. else
  4538. eval "$shlibpath_var=\"\$dir:\$$shlibpath_var\""
  4539. fi
  4540. done
  4541. # This variable tells wrapper scripts just to set shlibpath_var
  4542. # rather than running their programs.
  4543. libtool_execute_magic="$magic"
  4544. # Check if any of the arguments is a wrapper script.
  4545. args=
  4546. for file
  4547. do
  4548. case $file in
  4549. -*) ;;
  4550. *)
  4551. # Do a test to see if this is really a libtool program.
  4552. if (sed -e '4q' $file | egrep "^# Generated by .*$PACKAGE") >/dev/null 2>&1; then
  4553. # If there is no directory component, then add one.
  4554. case $file in
  4555. */* | *\\*) . $file ;;
  4556. *) . ./$file ;;
  4557. esac
  4558. # Transform arg to wrapped name.
  4559. file="$progdir/$program"
  4560. fi
  4561. ;;
  4562. esac
  4563. # Quote arguments (to preserve shell metacharacters).
  4564. file=`$echo "X$file" | $Xsed -e "$sed_quote_subst"`
  4565. args="$args \"$file\""
  4566. done
  4567. if test -z "$run"; then
  4568. if test -n "$shlibpath_var"; then
  4569. # Export the shlibpath_var.
  4570. eval "export $shlibpath_var"
  4571. fi
  4572. # Restore saved enviroment variables
  4573. if test "${save_LC_ALL+set}" = set; then
  4574. LC_ALL="$save_LC_ALL"; export LC_ALL
  4575. fi
  4576. if test "${save_LANG+set}" = set; then
  4577. LANG="$save_LANG"; export LANG
  4578. fi
  4579. # Now prepare to actually exec the command.
  4580. exec_cmd='"$cmd"$args'
  4581. else
  4582. # Display what would be done.
  4583. if test -n "$shlibpath_var"; then
  4584. eval "\$echo \"\$shlibpath_var=\$$shlibpath_var\""
  4585. $echo "export $shlibpath_var"
  4586. fi
  4587. $echo "$cmd$args"
  4588. exit 0
  4589. fi
  4590. ;;
  4591. # libtool clean and uninstall mode
  4592. clean | uninstall)
  4593. modename="$modename: $mode"
  4594. rm="$nonopt"
  4595. files=
  4596. rmforce=
  4597. exit_status=0
  4598. # This variable tells wrapper scripts just to set variables rather
  4599. # than running their programs.
  4600. libtool_install_magic="$magic"
  4601. for arg
  4602. do
  4603. case $arg in
  4604. -f) rm="$rm $arg"; rmforce=yes ;;
  4605. -*) rm="$rm $arg" ;;
  4606. *) files="$files $arg" ;;
  4607. esac
  4608. done
  4609. if test -z "$rm"; then
  4610. $echo "$modename: you must specify an RM program" 1>&2
  4611. $echo "$help" 1>&2
  4612. exit 1
  4613. fi
  4614. rmdirs=
  4615. for file in $files; do
  4616. dir=`$echo "X$file" | $Xsed -e 's%/[^/]*$%%'`
  4617. if test "X$dir" = "X$file"; then
  4618. dir=.
  4619. objdir="$objdir"
  4620. else
  4621. objdir="$dir/$objdir"
  4622. fi
  4623. name=`$echo "X$file" | $Xsed -e 's%^.*/%%'`
  4624. test $mode = uninstall && objdir="$dir"
  4625. # Remember objdir for removal later, being careful to avoid duplicates
  4626. if test $mode = clean; then
  4627. case " $rmdirs " in
  4628. *" $objdir "*) ;;
  4629. *) rmdirs="$rmdirs $objdir" ;;
  4630. esac
  4631. fi
  4632. # Don't error if the file doesn't exist and rm -f was used.
  4633. if (test -L "$file") >/dev/null 2>&1 \
  4634. || (test -h "$file") >/dev/null 2>&1 \
  4635. || test -f "$file"; then
  4636. :
  4637. elif test -d "$file"; then
  4638. exit_status=1
  4639. continue
  4640. elif test "$rmforce" = yes; then
  4641. continue
  4642. fi
  4643. rmfiles="$file"
  4644. case $name in
  4645. *.la)
  4646. # Possibly a libtool archive, so verify it.
  4647. if (sed -e '2q' $file | egrep "^# Generated by .*$PACKAGE") >/dev/null 2>&1; then
  4648. . $dir/$name
  4649. # Delete the libtool libraries and symlinks.
  4650. for n in $library_names; do
  4651. rmfiles="$rmfiles $objdir/$n"
  4652. done
  4653. test -n "$old_library" && rmfiles="$rmfiles $objdir/$old_library"
  4654. test $mode = clean && rmfiles="$rmfiles $objdir/$name $objdir/${name}i"
  4655. if test $mode = uninstall; then
  4656. if test -n "$library_names"; then
  4657. # Do each command in the postuninstall commands.
  4658. eval cmds=\"$postuninstall_cmds\"
  4659. IFS="${IFS= }"; save_ifs="$IFS"; IFS='~'
  4660. for cmd in $cmds; do
  4661. IFS="$save_ifs"
  4662. $show "$cmd"
  4663. $run eval "$cmd"
  4664. if test $? != 0 && test "$rmforce" != yes; then
  4665. exit_status=1
  4666. fi
  4667. done
  4668. IFS="$save_ifs"
  4669. fi
  4670. if test -n "$old_library"; then
  4671. # Do each command in the old_postuninstall commands.
  4672. eval cmds=\"$old_postuninstall_cmds\"
  4673. IFS="${IFS= }"; save_ifs="$IFS"; IFS='~'
  4674. for cmd in $cmds; do
  4675. IFS="$save_ifs"
  4676. $show "$cmd"
  4677. $run eval "$cmd"
  4678. if test $? != 0 && test "$rmforce" != yes; then
  4679. exit_status=1
  4680. fi
  4681. done
  4682. IFS="$save_ifs"
  4683. fi
  4684. # FIXME: should reinstall the best remaining shared library.
  4685. fi
  4686. fi
  4687. ;;
  4688. *.lo)
  4689. # Possibly a libtool object, so verify it.
  4690. if (sed -e '2q' $file | egrep "^# Generated by .*$PACKAGE") >/dev/null 2>&1; then
  4691. # Read the .lo file
  4692. . $dir/$name
  4693. # Add PIC object to the list of files to remove.
  4694. if test -n "$pic_object" \
  4695. && test "$pic_object" != none; then
  4696. rmfiles="$rmfiles $dir/$pic_object"
  4697. fi
  4698. # Add non-PIC object to the list of files to remove.
  4699. if test -n "$non_pic_object" \
  4700. && test "$non_pic_object" != none; then
  4701. rmfiles="$rmfiles $dir/$non_pic_object"
  4702. fi
  4703. fi
  4704. ;;
  4705. *)
  4706. # Do a test to see if this is a libtool program.
  4707. if test $mode = clean &&
  4708. (sed -e '4q' $file | egrep "^# Generated by .*$PACKAGE") >/dev/null 2>&1; then
  4709. relink_command=
  4710. . $dir/$file
  4711. rmfiles="$rmfiles $objdir/$name $objdir/${name}S.${objext}"
  4712. if test "$fast_install" = yes && test -n "$relink_command"; then
  4713. rmfiles="$rmfiles $objdir/lt-$name"
  4714. fi
  4715. fi
  4716. ;;
  4717. esac
  4718. $show "$rm $rmfiles"
  4719. $run $rm $rmfiles || exit_status=1
  4720. done
  4721. # Try to remove the ${objdir}s in the directories where we deleted files
  4722. for dir in $rmdirs; do
  4723. if test -d "$dir"; then
  4724. $show "rmdir $dir"
  4725. $run rmdir $dir >/dev/null 2>&1
  4726. fi
  4727. done
  4728. exit $exit_status
  4729. ;;
  4730. "")
  4731. $echo "$modename: you must specify a MODE" 1>&2
  4732. $echo "$generic_help" 1>&2
  4733. exit 1
  4734. ;;
  4735. esac
  4736. if test -z "$exec_cmd"; then
  4737. $echo "$modename: invalid operation mode \`$mode'" 1>&2
  4738. $echo "$generic_help" 1>&2
  4739. exit 1
  4740. fi
  4741. fi # test -z "$show_help"
  4742. if test -n "$exec_cmd"; then
  4743. eval exec $exec_cmd
  4744. exit 1
  4745. fi
  4746. # We need to display help for each of the modes.
  4747. case $mode in
  4748. "") $echo \
  4749. "Usage: $modename [OPTION]... [MODE-ARG]...
  4750. Provide generalized library-building support services.
  4751. --config show all configuration variables
  4752. --debug enable verbose shell tracing
  4753. -n, --dry-run display commands without modifying any files
  4754. --features display basic configuration information and exit
  4755. --finish same as \`--mode=finish'
  4756. --help display this help message and exit
  4757. --mode=MODE use operation mode MODE [default=inferred from MODE-ARGS]
  4758. --quiet same as \`--silent'
  4759. --silent don't print informational messages
  4760. --tag=TAG use configuration variables from tag TAG
  4761. --version print version information
  4762. MODE must be one of the following:
  4763. clean remove files from the build directory
  4764. compile compile a source file into a libtool object
  4765. execute automatically set library path, then run a program
  4766. finish complete the installation of libtool libraries
  4767. install install libraries or executables
  4768. link create a library or an executable
  4769. uninstall remove libraries from an installed directory
  4770. MODE-ARGS vary depending on the MODE. Try \`$modename --help --mode=MODE' for
  4771. a more detailed description of MODE."
  4772. exit 0
  4773. ;;
  4774. clean)
  4775. $echo \
  4776. "Usage: $modename [OPTION]... --mode=clean RM [RM-OPTION]... FILE...
  4777. Remove files from the build directory.
  4778. RM is the name of the program to use to delete files associated with each FILE
  4779. (typically \`/bin/rm'). RM-OPTIONS are options (such as \`-f') to be passed
  4780. to RM.
  4781. If FILE is a libtool library, object or program, all the files associated
  4782. with it are deleted. Otherwise, only FILE itself is deleted using RM."
  4783. ;;
  4784. compile)
  4785. $echo \
  4786. "Usage: $modename [OPTION]... --mode=compile COMPILE-COMMAND... SOURCEFILE
  4787. Compile a source file into a libtool library object.
  4788. This mode accepts the following additional options:
  4789. -o OUTPUT-FILE set the output file name to OUTPUT-FILE
  4790. -prefer-pic try to building PIC objects only
  4791. -prefer-non-pic try to building non-PIC objects only
  4792. -static always build a \`.o' file suitable for static linking
  4793. COMPILE-COMMAND is a command to be used in creating a \`standard' object file
  4794. from the given SOURCEFILE.
  4795. The output file name is determined by removing the directory component from
  4796. SOURCEFILE, then substituting the C source code suffix \`.c' with the
  4797. library object suffix, \`.lo'."
  4798. ;;
  4799. execute)
  4800. $echo \
  4801. "Usage: $modename [OPTION]... --mode=execute COMMAND [ARGS]...
  4802. Automatically set library path, then run a program.
  4803. This mode accepts the following additional options:
  4804. -dlopen FILE add the directory containing FILE to the library path
  4805. This mode sets the library path environment variable according to \`-dlopen'
  4806. flags.
  4807. If any of the ARGS are libtool executable wrappers, then they are translated
  4808. into their corresponding uninstalled binary, and any of their required library
  4809. directories are added to the library path.
  4810. Then, COMMAND is executed, with ARGS as arguments."
  4811. ;;
  4812. finish)
  4813. $echo \
  4814. "Usage: $modename [OPTION]... --mode=finish [LIBDIR]...
  4815. Complete the installation of libtool libraries.
  4816. Each LIBDIR is a directory that contains libtool libraries.
  4817. The commands that this mode executes may require superuser privileges. Use
  4818. the \`--dry-run' option if you just want to see what would be executed."
  4819. ;;
  4820. install)
  4821. $echo \
  4822. "Usage: $modename [OPTION]... --mode=install INSTALL-COMMAND...
  4823. Install executables or libraries.
  4824. INSTALL-COMMAND is the installation command. The first component should be
  4825. either the \`install' or \`cp' program.
  4826. The rest of the components are interpreted as arguments to that command (only
  4827. BSD-compatible install options are recognized)."
  4828. ;;
  4829. link)
  4830. $echo \
  4831. "Usage: $modename [OPTION]... --mode=link LINK-COMMAND...
  4832. Link object files or libraries together to form another library, or to
  4833. create an executable program.
  4834. LINK-COMMAND is a command using the C compiler that you would use to create
  4835. a program from several object files.
  4836. The following components of LINK-COMMAND are treated specially:
  4837. -all-static do not do any dynamic linking at all
  4838. -avoid-version do not add a version suffix if possible
  4839. -dlopen FILE \`-dlpreopen' FILE if it cannot be dlopened at runtime
  4840. -dlpreopen FILE link in FILE and add its symbols to lt_preloaded_symbols
  4841. -export-dynamic allow symbols from OUTPUT-FILE to be resolved with dlsym(3)
  4842. -export-symbols SYMFILE
  4843. try to export only the symbols listed in SYMFILE
  4844. -export-symbols-regex REGEX
  4845. try to export only the symbols matching REGEX
  4846. -LLIBDIR search LIBDIR for required installed libraries
  4847. -lNAME OUTPUT-FILE requires the installed library libNAME
  4848. -module build a library that can dlopened
  4849. -no-fast-install disable the fast-install mode
  4850. -no-install link a not-installable executable
  4851. -no-undefined declare that a library does not refer to external symbols
  4852. -o OUTPUT-FILE create OUTPUT-FILE from the specified objects
  4853. -objectlist FILE Use a list of object files found in FILE to specify objects
  4854. -release RELEASE specify package release information
  4855. -rpath LIBDIR the created library will eventually be installed in LIBDIR
  4856. -R[ ]LIBDIR add LIBDIR to the runtime path of programs and libraries
  4857. -static do not do any dynamic linking of libtool libraries
  4858. -version-info CURRENT[:REVISION[:AGE]]
  4859. specify library version info [each variable defaults to 0]
  4860. All other options (arguments beginning with \`-') are ignored.
  4861. Every other argument is treated as a filename. Files ending in \`.la' are
  4862. treated as uninstalled libtool libraries, other files are standard or library
  4863. object files.
  4864. If the OUTPUT-FILE ends in \`.la', then a libtool library is created,
  4865. only library objects (\`.lo' files) may be specified, and \`-rpath' is
  4866. required, except when creating a convenience library.
  4867. If OUTPUT-FILE ends in \`.a' or \`.lib', then a standard library is created
  4868. using \`ar' and \`ranlib', or on Windows using \`lib'.
  4869. If OUTPUT-FILE ends in \`.lo' or \`.${objext}', then a reloadable object file
  4870. is created, otherwise an executable program is created."
  4871. ;;
  4872. uninstall)
  4873. $echo \
  4874. "Usage: $modename [OPTION]... --mode=uninstall RM [RM-OPTION]... FILE...
  4875. Remove libraries from an installation directory.
  4876. RM is the name of the program to use to delete files associated with each FILE
  4877. (typically \`/bin/rm'). RM-OPTIONS are options (such as \`-f') to be passed
  4878. to RM.
  4879. If FILE is a libtool library, all the files associated with it are deleted.
  4880. Otherwise, only FILE itself is deleted using RM."
  4881. ;;
  4882. *)
  4883. $echo "$modename: invalid operation mode \`$mode'" 1>&2
  4884. $echo "$help" 1>&2
  4885. exit 1
  4886. ;;
  4887. esac
  4888. echo
  4889. $echo "Try \`$modename --help' for more information about other modes."
  4890. exit 0
  4891. # The TAGs below are defined such that we never get into a situation
  4892. # in which we disable both kinds of libraries. Given conflicting
  4893. # choices, we go for a static library, that is the most portable,
  4894. # since we can't tell whether shared libraries were disabled because
  4895. # the user asked for that or because the platform doesn't support
  4896. # them. This is particularly important on AIX, because we don't
  4897. # support having both static and shared libraries enabled at the same
  4898. # time on that platform, so we default to a shared-only configuration.
  4899. # If a disable-shared tag is given, we'll fallback to a static-only
  4900. # configuration. But we'll never go from static-only to shared-only.
  4901. # ### BEGIN LIBTOOL TAG CONFIG: disable-shared
  4902. build_libtool_libs=no
  4903. build_old_libs=yes
  4904. # ### END LIBTOOL TAG CONFIG: disable-shared
  4905. # ### BEGIN LIBTOOL TAG CONFIG: disable-static
  4906. build_old_libs=`case $build_libtool_libs in yes) echo no;; *) echo yes;; esac`
  4907. # ### END LIBTOOL TAG CONFIG: disable-static
  4908. # Local Variables:
  4909. # mode:shell-script
  4910. # sh-indentation:2
  4911. # End: