ltmain.sh 130 KB

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