libtool 144 KB

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