ltmain.sh 142 KB

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