libtool 139 KB

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