ltmain.sh 138 KB

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