ltconfig 95 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677787980818283848586878889909192939495969798991001011021031041051061071081091101111121131141151161171181191201211221231241251261271281291301311321331341351361371381391401411421431441451461471481491501511521531541551561571581591601611621631641651661671681691701711721731741751761771781791801811821831841851861871881891901911921931941951961971981992002012022032042052062072082092102112122132142152162172182192202212222232242252262272282292302312322332342352362372382392402412422432442452462472482492502512522532542552562572582592602612622632642652662672682692702712722732742752762772782792802812822832842852862872882892902912922932942952962972982993003013023033043053063073083093103113123133143153163173183193203213223233243253263273283293303313323333343353363373383393403413423433443453463473483493503513523533543553563573583593603613623633643653663673683693703713723733743753763773783793803813823833843853863873883893903913923933943953963973983994004014024034044054064074084094104114124134144154164174184194204214224234244254264274284294304314324334344354364374384394404414424434444454464474484494504514524534544554564574584594604614624634644654664674684694704714724734744754764774784794804814824834844854864874884894904914924934944954964974984995005015025035045055065075085095105115125135145155165175185195205215225235245255265275285295305315325335345355365375385395405415425435445455465475485495505515525535545555565575585595605615625635645655665675685695705715725735745755765775785795805815825835845855865875885895905915925935945955965975985996006016026036046056066076086096106116126136146156166176186196206216226236246256266276286296306316326336346356366376386396406416426436446456466476486496506516526536546556566576586596606616626636646656666676686696706716726736746756766776786796806816826836846856866876886896906916926936946956966976986997007017027037047057067077087097107117127137147157167177187197207217227237247257267277287297307317327337347357367377387397407417427437447457467477487497507517527537547557567577587597607617627637647657667677687697707717727737747757767777787797807817827837847857867877887897907917927937947957967977987998008018028038048058068078088098108118128138148158168178188198208218228238248258268278288298308318328338348358368378388398408418428438448458468478488498508518528538548558568578588598608618628638648658668678688698708718728738748758768778788798808818828838848858868878888898908918928938948958968978988999009019029039049059069079089099109119129139149159169179189199209219229239249259269279289299309319329339349359369379389399409419429439449459469479489499509519529539549559569579589599609619629639649659669679689699709719729739749759769779789799809819829839849859869879889899909919929939949959969979989991000100110021003100410051006100710081009101010111012101310141015101610171018101910201021102210231024102510261027102810291030103110321033103410351036103710381039104010411042104310441045104610471048104910501051105210531054105510561057105810591060106110621063106410651066106710681069107010711072107310741075107610771078107910801081108210831084108510861087108810891090109110921093109410951096109710981099110011011102110311041105110611071108110911101111111211131114111511161117111811191120112111221123112411251126112711281129113011311132113311341135113611371138113911401141114211431144114511461147114811491150115111521153115411551156115711581159116011611162116311641165116611671168116911701171117211731174117511761177117811791180118111821183118411851186118711881189119011911192119311941195119611971198119912001201120212031204120512061207120812091210121112121213121412151216121712181219122012211222122312241225122612271228122912301231123212331234123512361237123812391240124112421243124412451246124712481249125012511252125312541255125612571258125912601261126212631264126512661267126812691270127112721273127412751276127712781279128012811282128312841285128612871288128912901291129212931294129512961297129812991300130113021303130413051306130713081309131013111312131313141315131613171318131913201321132213231324132513261327132813291330133113321333133413351336133713381339134013411342134313441345134613471348134913501351135213531354135513561357135813591360136113621363136413651366136713681369137013711372137313741375137613771378137913801381138213831384138513861387138813891390139113921393139413951396139713981399140014011402140314041405140614071408140914101411141214131414141514161417141814191420142114221423142414251426142714281429143014311432143314341435143614371438143914401441144214431444144514461447144814491450145114521453145414551456145714581459146014611462146314641465146614671468146914701471147214731474147514761477147814791480148114821483148414851486148714881489149014911492149314941495149614971498149915001501150215031504150515061507150815091510151115121513151415151516151715181519152015211522152315241525152615271528152915301531153215331534153515361537153815391540154115421543154415451546154715481549155015511552155315541555155615571558155915601561156215631564156515661567156815691570157115721573157415751576157715781579158015811582158315841585158615871588158915901591159215931594159515961597159815991600160116021603160416051606160716081609161016111612161316141615161616171618161916201621162216231624162516261627162816291630163116321633163416351636163716381639164016411642164316441645164616471648164916501651165216531654165516561657165816591660166116621663166416651666166716681669167016711672167316741675167616771678167916801681168216831684168516861687168816891690169116921693169416951696169716981699170017011702170317041705170617071708170917101711171217131714171517161717171817191720172117221723172417251726172717281729173017311732173317341735173617371738173917401741174217431744174517461747174817491750175117521753175417551756175717581759176017611762176317641765176617671768176917701771177217731774177517761777177817791780178117821783178417851786178717881789179017911792179317941795179617971798179918001801180218031804180518061807180818091810181118121813181418151816181718181819182018211822182318241825182618271828182918301831183218331834183518361837183818391840184118421843184418451846184718481849185018511852185318541855185618571858185918601861186218631864186518661867186818691870187118721873187418751876187718781879188018811882188318841885188618871888188918901891189218931894189518961897189818991900190119021903190419051906190719081909191019111912191319141915191619171918191919201921192219231924192519261927192819291930193119321933193419351936193719381939194019411942194319441945194619471948194919501951195219531954195519561957195819591960196119621963196419651966196719681969197019711972197319741975197619771978197919801981198219831984198519861987198819891990199119921993199419951996199719981999200020012002200320042005200620072008200920102011201220132014201520162017201820192020202120222023202420252026202720282029203020312032203320342035203620372038203920402041204220432044204520462047204820492050205120522053205420552056205720582059206020612062206320642065206620672068206920702071207220732074207520762077207820792080208120822083208420852086208720882089209020912092209320942095209620972098209921002101210221032104210521062107210821092110211121122113211421152116211721182119212021212122212321242125212621272128212921302131213221332134213521362137213821392140214121422143214421452146214721482149215021512152215321542155215621572158215921602161216221632164216521662167216821692170217121722173217421752176217721782179218021812182218321842185218621872188218921902191219221932194219521962197219821992200220122022203220422052206220722082209221022112212221322142215221622172218221922202221222222232224222522262227222822292230223122322233223422352236223722382239224022412242224322442245224622472248224922502251225222532254225522562257225822592260226122622263226422652266226722682269227022712272227322742275227622772278227922802281228222832284228522862287228822892290229122922293229422952296229722982299230023012302230323042305230623072308230923102311231223132314231523162317231823192320232123222323232423252326232723282329233023312332233323342335233623372338233923402341234223432344234523462347234823492350235123522353235423552356235723582359236023612362236323642365236623672368236923702371237223732374237523762377237823792380238123822383238423852386238723882389239023912392239323942395239623972398239924002401240224032404240524062407240824092410241124122413241424152416241724182419242024212422242324242425242624272428242924302431243224332434243524362437243824392440244124422443244424452446244724482449245024512452245324542455245624572458245924602461246224632464246524662467246824692470247124722473247424752476247724782479248024812482248324842485248624872488248924902491249224932494249524962497249824992500250125022503250425052506250725082509251025112512251325142515251625172518251925202521252225232524252525262527252825292530253125322533253425352536253725382539254025412542254325442545254625472548254925502551255225532554255525562557255825592560256125622563256425652566256725682569257025712572257325742575257625772578257925802581258225832584258525862587258825892590259125922593259425952596259725982599260026012602260326042605260626072608260926102611261226132614261526162617261826192620262126222623262426252626262726282629263026312632263326342635263626372638263926402641264226432644264526462647264826492650265126522653265426552656265726582659266026612662266326642665266626672668266926702671267226732674267526762677267826792680268126822683268426852686268726882689269026912692269326942695269626972698269927002701270227032704270527062707270827092710271127122713271427152716271727182719272027212722272327242725272627272728272927302731273227332734273527362737273827392740274127422743274427452746274727482749275027512752275327542755275627572758275927602761276227632764276527662767276827692770277127722773277427752776277727782779278027812782278327842785278627872788278927902791279227932794279527962797279827992800280128022803280428052806280728082809281028112812281328142815281628172818281928202821282228232824282528262827282828292830283128322833283428352836283728382839284028412842284328442845284628472848284928502851285228532854285528562857285828592860286128622863286428652866286728682869287028712872287328742875287628772878287928802881288228832884288528862887288828892890289128922893289428952896289728982899290029012902290329042905290629072908290929102911291229132914291529162917291829192920292129222923292429252926292729282929293029312932293329342935293629372938293929402941294229432944294529462947294829492950295129522953295429552956295729582959296029612962296329642965296629672968296929702971297229732974297529762977297829792980298129822983298429852986298729882989299029912992299329942995299629972998299930003001300230033004300530063007300830093010301130123013301430153016301730183019302030213022302330243025302630273028302930303031303230333034303530363037303830393040304130423043304430453046304730483049305030513052305330543055305630573058305930603061306230633064306530663067306830693070307130723073307430753076307730783079308030813082308330843085308630873088308930903091309230933094309530963097309830993100310131023103310431053106310731083109311031113112311331143115
  1. #! /bin/sh
  2. # ltconfig - Create a system-specific libtool.
  3. # Copyright (C) 1996-1999 Free Software Foundation, Inc.
  4. # Originally by Gordon Matzigkeit <gord@gnu.ai.mit.edu>, 1996
  5. #
  6. # This file is free software; you can redistribute it and/or modify it
  7. # under the terms of the GNU General Public License as published by
  8. # the Free Software Foundation; either version 2 of the License, or
  9. # (at your option) any later version.
  10. #
  11. # This program is distributed in the hope that it will be useful, but
  12. # WITHOUT ANY WARRANTY; without even the implied warranty of
  13. # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
  14. # General Public License for more details.
  15. #
  16. # You should have received a copy of the GNU General Public License
  17. # along with this program; if not, write to the Free Software
  18. # Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
  19. #
  20. # As a special exception to the GNU General Public License, if you
  21. # distribute this file as part of a program that contains a
  22. # configuration script generated by Autoconf, you may include it under
  23. # the same distribution terms that you use for the rest of that program.
  24. # A lot of this script is taken from autoconf-2.10.
  25. # Check that we are running under the correct shell.
  26. SHELL=${CONFIG_SHELL-/bin/sh}
  27. echo=echo
  28. if test "X$1" = X--no-reexec; then
  29. # Discard the --no-reexec flag, and continue.
  30. shift
  31. elif test "X$1" = X--fallback-echo; then
  32. # Avoid inline document here, it may be left over
  33. :
  34. elif test "X`($echo '\t') 2>/dev/null`" = 'X\t'; then
  35. # Yippee, $echo works!
  36. :
  37. else
  38. # Restart under the correct shell.
  39. exec "$SHELL" "$0" --no-reexec ${1+"$@"}
  40. fi
  41. if test "X$1" = X--fallback-echo; then
  42. # used as fallback echo
  43. shift
  44. cat <<EOF
  45. $*
  46. EOF
  47. exit 0
  48. fi
  49. # Find the correct PATH separator. Usually this is `:', but
  50. # DJGPP uses `;' like DOS.
  51. if test "X${PATH_SEPARATOR+set}" != Xset; then
  52. UNAME=${UNAME-`uname 2>/dev/null`}
  53. case X$UNAME in
  54. *-DOS) PATH_SEPARATOR=';' ;;
  55. *) PATH_SEPARATOR=':' ;;
  56. esac
  57. fi
  58. # The HP-UX ksh and POSIX shell print the target directory to stdout
  59. # if CDPATH is set.
  60. if test "X${CDPATH+set}" = Xset; then CDPATH=:; export CDPATH; fi
  61. if test "X${echo_test_string+set}" != Xset; then
  62. # find a string as large as possible, as long as the shell can cope with it
  63. for cmd in 'sed 50q "$0"' 'sed 20q "$0"' 'sed 10q "$0"' 'sed 2q "$0"' 'echo test'; do
  64. # expected sizes: less than 2Kb, 1Kb, 512 bytes, 16 bytes, ...
  65. if (echo_test_string="`eval $cmd`") 2>/dev/null &&
  66. echo_test_string="`eval $cmd`" &&
  67. (test "X$echo_test_string" = "X$echo_test_string") 2>/dev/null; then
  68. break
  69. fi
  70. done
  71. fi
  72. if test "X`($echo '\t') 2>/dev/null`" != 'X\t' ||
  73. test "X`($echo "$echo_test_string") 2>/dev/null`" != X"$echo_test_string"; then
  74. # The Solaris, AIX, and Digital Unix default echo programs unquote
  75. # backslashes. This makes it impossible to quote backslashes using
  76. # echo "$something" | sed 's/\\/\\\\/g'
  77. #
  78. # So, first we look for a working echo in the user's PATH.
  79. IFS="${IFS= }"; save_ifs="$IFS"; IFS="${IFS}${PATH_SEPARATOR}"
  80. for dir in $PATH /usr/ucb; do
  81. if (test -f $dir/echo || test -f $dir/echo$ac_exeext) &&
  82. test "X`($dir/echo '\t') 2>/dev/null`" = 'X\t' &&
  83. test "X`($dir/echo "$echo_test_string") 2>/dev/null`" = X"$echo_test_string"; then
  84. echo="$dir/echo"
  85. break
  86. fi
  87. done
  88. IFS="$save_ifs"
  89. if test "X$echo" = Xecho; then
  90. # We didn't find a better echo, so look for alternatives.
  91. if test "X`(print -r '\t') 2>/dev/null`" = 'X\t' &&
  92. test "X`(print -r "$echo_test_string") 2>/dev/null`" = X"$echo_test_string"; then
  93. # This shell has a builtin print -r that does the trick.
  94. echo='print -r'
  95. elif (test -f /bin/ksh || test -f /bin/ksh$ac_exeext) &&
  96. test "X$CONFIG_SHELL" != X/bin/ksh; then
  97. # If we have ksh, try running ltconfig again with it.
  98. ORIGINAL_CONFIG_SHELL="${CONFIG_SHELL-/bin/sh}"
  99. export ORIGINAL_CONFIG_SHELL
  100. CONFIG_SHELL=/bin/ksh
  101. export CONFIG_SHELL
  102. exec "$CONFIG_SHELL" "$0" --no-reexec ${1+"$@"}
  103. else
  104. # Try using printf.
  105. echo='printf "%s\n"'
  106. if test "X`($echo '\t') 2>/dev/null`" = 'X\t' &&
  107. test "X`($echo "$echo_test_string") 2>/dev/null`" = X"$echo_test_string"; then
  108. # Cool, printf works
  109. :
  110. elif test "X`("$ORIGINAL_CONFIG_SHELL" "$0" --fallback-echo '\t') 2>/dev/null`" = 'X\t' &&
  111. test "X`("$ORIGINAL_CONFIG_SHELL" "$0" --fallback-echo "$echo_test_string") 2>/dev/null`" = X"$echo_test_string"; then
  112. CONFIG_SHELL="$ORIGINAL_CONFIG_SHELL"
  113. export CONFIG_SHELL
  114. SHELL="$CONFIG_SHELL"
  115. export SHELL
  116. echo="$CONFIG_SHELL $0 --fallback-echo"
  117. elif test "X`("$CONFIG_SHELL" "$0" --fallback-echo '\t') 2>/dev/null`" = 'X\t' &&
  118. test "X`("$CONFIG_SHELL" "$0" --fallback-echo "$echo_test_string") 2>/dev/null`" = X"$echo_test_string"; then
  119. echo="$CONFIG_SHELL $0 --fallback-echo"
  120. else
  121. # maybe with a smaller string...
  122. prev=:
  123. for cmd in 'echo test' 'sed 2q "$0"' 'sed 10q "$0"' 'sed 20q "$0"' 'sed 50q "$0"'; do
  124. if (test "X$echo_test_string" = "X`eval $cmd`") 2>/dev/null; then
  125. break
  126. fi
  127. prev="$cmd"
  128. done
  129. if test "$prev" != 'sed 50q "$0"'; then
  130. echo_test_string=`eval $prev`
  131. export echo_test_string
  132. exec "${ORIGINAL_CONFIG_SHELL}" "$0" ${1+"$@"}
  133. else
  134. # Oops. We lost completely, so just stick with echo.
  135. echo=echo
  136. fi
  137. fi
  138. fi
  139. fi
  140. fi
  141. # Sed substitution that helps us do robust quoting. It backslashifies
  142. # metacharacters that are still active within double-quoted strings.
  143. Xsed='sed -e s/^X//'
  144. sed_quote_subst='s/\([\\"\\`$\\\\]\)/\\\1/g'
  145. # Same as above, but do not quote variable references.
  146. double_quote_subst='s/\([\\"\\`\\\\]\)/\\\1/g'
  147. # Sed substitution to delay expansion of an escaped shell variable in a
  148. # double_quote_subst'ed string.
  149. delay_variable_subst='s/\\\\\\\\\\\$/\\\\\\$/g'
  150. # The name of this program.
  151. progname=`$echo "X$0" | $Xsed -e 's%^.*/%%'`
  152. # Constants:
  153. PROGRAM=ltconfig
  154. PACKAGE=libtool
  155. VERSION=1.3.5
  156. TIMESTAMP=" (1.385.2.206 2000/05/27 11:12:27)"
  157. ac_compile='${CC-cc} -c $CFLAGS $CPPFLAGS conftest.$ac_ext 1>&5'
  158. ac_link='${CC-cc} -o conftest $CFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS 1>&5'
  159. rm="rm -f"
  160. help="Try \`$progname --help' for more information."
  161. # Global variables:
  162. default_ofile=libtool
  163. can_build_shared=yes
  164. enable_shared=yes
  165. # All known linkers require a `.a' archive for static linking (except M$VC,
  166. # which needs '.lib').
  167. enable_static=yes
  168. enable_fast_install=yes
  169. enable_dlopen=unknown
  170. enable_win32_dll=no
  171. ltmain=
  172. silent=
  173. srcdir=
  174. ac_config_guess=
  175. ac_config_sub=
  176. host=
  177. nonopt=
  178. ofile="$default_ofile"
  179. verify_host=yes
  180. with_gcc=no
  181. with_gnu_ld=no
  182. need_locks=yes
  183. ac_ext=c
  184. objext=o
  185. libext=a
  186. exeext=
  187. cache_file=
  188. old_AR="$AR"
  189. old_CC="$CC"
  190. old_CFLAGS="$CFLAGS"
  191. old_CPPFLAGS="$CPPFLAGS"
  192. old_LDFLAGS="$LDFLAGS"
  193. old_LD="$LD"
  194. old_LN_S="$LN_S"
  195. old_LIBS="$LIBS"
  196. old_NM="$NM"
  197. old_RANLIB="$RANLIB"
  198. old_DLLTOOL="$DLLTOOL"
  199. old_OBJDUMP="$OBJDUMP"
  200. old_AS="$AS"
  201. # Parse the command line options.
  202. args=
  203. prev=
  204. for option
  205. do
  206. case "$option" in
  207. -*=*) optarg=`echo "$option" | sed 's/[-_a-zA-Z0-9]*=//'` ;;
  208. *) optarg= ;;
  209. esac
  210. # If the previous option needs an argument, assign it.
  211. if test -n "$prev"; then
  212. eval "$prev=\$option"
  213. prev=
  214. continue
  215. fi
  216. case "$option" in
  217. --help) cat <<EOM
  218. Usage: $progname [OPTION]... [HOST [LTMAIN]]
  219. Generate a system-specific libtool script.
  220. --debug enable verbose shell tracing
  221. --disable-shared do not build shared libraries
  222. --disable-static do not build static libraries
  223. --disable-fast-install do not optimize for fast installation
  224. --enable-dlopen enable dlopen support
  225. --enable-win32-dll enable building dlls on win32 hosts
  226. --help display this help and exit
  227. --no-verify do not verify that HOST is a valid host type
  228. -o, --output=FILE specify the output file [default=$default_ofile]
  229. --quiet same as \`--silent'
  230. --silent do not print informational messages
  231. --srcdir=DIR find \`config.guess' in DIR
  232. --version output version information and exit
  233. --with-gcc assume that the GNU C compiler will be used
  234. --with-gnu-ld assume that the C compiler uses the GNU linker
  235. --disable-lock disable file locking
  236. --cache-file=FILE configure cache file
  237. LTMAIN is the \`ltmain.sh' shell script fragment or \`ltmain.c' program
  238. that provides basic libtool functionality.
  239. HOST is the canonical host system name [default=guessed].
  240. EOM
  241. exit 0
  242. ;;
  243. --debug)
  244. echo "$progname: enabling shell trace mode"
  245. set -x
  246. ;;
  247. --disable-shared) enable_shared=no ;;
  248. --disable-static) enable_static=no ;;
  249. --disable-fast-install) enable_fast_install=no ;;
  250. --enable-dlopen) enable_dlopen=yes ;;
  251. --enable-win32-dll) enable_win32_dll=yes ;;
  252. --quiet | --silent) silent=yes ;;
  253. --srcdir) prev=srcdir ;;
  254. --srcdir=*) srcdir="$optarg" ;;
  255. --no-verify) verify_host=no ;;
  256. --output | -o) prev=ofile ;;
  257. --output=*) ofile="$optarg" ;;
  258. --version) echo "$PROGRAM (GNU $PACKAGE) $VERSION$TIMESTAMP"; exit 0 ;;
  259. --with-gcc) with_gcc=yes ;;
  260. --with-gnu-ld) with_gnu_ld=yes ;;
  261. --disable-lock) need_locks=no ;;
  262. --cache-file=*) cache_file="$optarg" ;;
  263. -*)
  264. echo "$progname: unrecognized option \`$option'" 1>&2
  265. echo "$help" 1>&2
  266. exit 1
  267. ;;
  268. *)
  269. if test -z "$ltmain"; then
  270. ltmain="$option"
  271. elif test -z "$host"; then
  272. # This generates an unnecessary warning for sparc-sun-solaris4.1.3_U1
  273. # if test -n "`echo $option| sed 's/[-a-z0-9.]//g'`"; then
  274. # echo "$progname: warning \`$option' is not a valid host type" 1>&2
  275. # fi
  276. host="$option"
  277. else
  278. echo "$progname: too many arguments" 1>&2
  279. echo "$help" 1>&2
  280. exit 1
  281. fi ;;
  282. esac
  283. done
  284. if test -z "$ltmain"; then
  285. echo "$progname: you must specify a LTMAIN file" 1>&2
  286. echo "$help" 1>&2
  287. exit 1
  288. fi
  289. if test ! -f "$ltmain"; then
  290. echo "$progname: \`$ltmain' does not exist" 1>&2
  291. echo "$help" 1>&2
  292. exit 1
  293. fi
  294. # Quote any args containing shell metacharacters.
  295. ltconfig_args=
  296. for arg
  297. do
  298. case "$arg" in
  299. *" "*|*" "*|*[\[\]\~\#\$\^\&\*\(\)\{\}\\\|\;\<\>\?]*)
  300. ltconfig_args="$ltconfig_args '$arg'" ;;
  301. *) ltconfig_args="$ltconfig_args $arg" ;;
  302. esac
  303. done
  304. # A relevant subset of AC_INIT.
  305. # File descriptor usage:
  306. # 0 standard input
  307. # 1 file creation
  308. # 2 errors and warnings
  309. # 3 some systems may open it to /dev/tty
  310. # 4 used on the Kubota Titan
  311. # 5 compiler messages saved in config.log
  312. # 6 checking for... messages and results
  313. if test "$silent" = yes; then
  314. exec 6>/dev/null
  315. else
  316. exec 6>&1
  317. fi
  318. exec 5>>./config.log
  319. # NLS nuisances.
  320. # Only set LANG and LC_ALL to C if already set.
  321. # These must not be set unconditionally because not all systems understand
  322. # e.g. LANG=C (notably SCO).
  323. if test "X${LC_ALL+set}" = Xset; then LC_ALL=C; export LC_ALL; fi
  324. if test "X${LANG+set}" = Xset; then LANG=C; export LANG; fi
  325. if test -n "$cache_file" && test -r "$cache_file"; then
  326. echo "loading cache $cache_file within ltconfig"
  327. . $cache_file
  328. fi
  329. if (echo "testing\c"; echo 1,2,3) | grep c >/dev/null; then
  330. # Stardent Vistra SVR4 grep lacks -e, says ghazi@caip.rutgers.edu.
  331. if (echo -n testing; echo 1,2,3) | sed s/-n/xn/ | grep xn >/dev/null; then
  332. ac_n= ac_c='
  333. ' ac_t=' '
  334. else
  335. ac_n=-n ac_c= ac_t=
  336. fi
  337. else
  338. ac_n= ac_c='\c' ac_t=
  339. fi
  340. if test -z "$srcdir"; then
  341. # Assume the source directory is the same one as the path to LTMAIN.
  342. srcdir=`$echo "X$ltmain" | $Xsed -e 's%/[^/]*$%%'`
  343. test "$srcdir" = "$ltmain" && srcdir=.
  344. fi
  345. trap "$rm conftest*; exit 1" 1 2 15
  346. if test "$verify_host" = yes; then
  347. # Check for config.guess and config.sub.
  348. ac_aux_dir=
  349. for ac_dir in $srcdir $srcdir/.. $srcdir/../..; do
  350. if test -f $ac_dir/config.guess; then
  351. ac_aux_dir=$ac_dir
  352. break
  353. fi
  354. done
  355. if test -z "$ac_aux_dir"; then
  356. echo "$progname: cannot find config.guess in $srcdir $srcdir/.. $srcdir/../.." 1>&2
  357. echo "$help" 1>&2
  358. exit 1
  359. fi
  360. ac_config_guess=$ac_aux_dir/config.guess
  361. ac_config_sub=$ac_aux_dir/config.sub
  362. # Make sure we can run config.sub.
  363. if $SHELL $ac_config_sub sun4 >/dev/null 2>&1; then :
  364. else
  365. echo "$progname: cannot run $ac_config_sub" 1>&2
  366. echo "$help" 1>&2
  367. exit 1
  368. fi
  369. echo $ac_n "checking host system type""... $ac_c" 1>&6
  370. host_alias=$host
  371. case "$host_alias" in
  372. "")
  373. if host_alias=`$SHELL $ac_config_guess`; then :
  374. else
  375. echo "$progname: cannot guess host type; you must specify one" 1>&2
  376. echo "$help" 1>&2
  377. exit 1
  378. fi ;;
  379. esac
  380. host=`$SHELL $ac_config_sub $host_alias`
  381. echo "$ac_t$host" 1>&6
  382. # Make sure the host verified.
  383. test -z "$host" && exit 1
  384. elif test -z "$host"; then
  385. echo "$progname: you must specify a host type if you use \`--no-verify'" 1>&2
  386. echo "$help" 1>&2
  387. exit 1
  388. else
  389. host_alias=$host
  390. fi
  391. # Transform linux* to *-*-linux-gnu*, to support old configure scripts.
  392. case "$host_os" in
  393. linux-gnu*) ;;
  394. linux*) host=`echo $host | sed 's/^\(.*-.*-linux\)\(.*\)$/\1-gnu\2/'`
  395. esac
  396. host_cpu=`echo $host | sed 's/^\([^-]*\)-\([^-]*\)-\(.*\)$/\1/'`
  397. host_vendor=`echo $host | sed 's/^\([^-]*\)-\([^-]*\)-\(.*\)$/\2/'`
  398. host_os=`echo $host | sed 's/^\([^-]*\)-\([^-]*\)-\(.*\)$/\3/'`
  399. case "$host_os" in
  400. aix3*)
  401. # AIX sometimes has problems with the GCC collect2 program. For some
  402. # reason, if we set the COLLECT_NAMES environment variable, the problems
  403. # vanish in a puff of smoke.
  404. if test "X${COLLECT_NAMES+set}" != Xset; then
  405. COLLECT_NAMES=
  406. export COLLECT_NAMES
  407. fi
  408. ;;
  409. esac
  410. # Determine commands to create old-style static archives.
  411. old_archive_cmds='$AR cru $oldlib$oldobjs'
  412. old_postinstall_cmds='chmod 644 $oldlib'
  413. old_postuninstall_cmds=
  414. # Set a sane default for `AR'.
  415. test -z "$AR" && AR=ar
  416. # Set a sane default for `OBJDUMP'.
  417. test -z "$OBJDUMP" && OBJDUMP=objdump
  418. # If RANLIB is not set, then run the test.
  419. if test "${RANLIB+set}" != "set"; then
  420. result=no
  421. echo $ac_n "checking for ranlib... $ac_c" 1>&6
  422. IFS="${IFS= }"; save_ifs="$IFS"; IFS="${IFS}${PATH_SEPARATOR}"
  423. for dir in $PATH; do
  424. test -z "$dir" && dir=.
  425. if test -f $dir/ranlib || test -f $dir/ranlib$ac_exeext; then
  426. RANLIB="ranlib"
  427. result="ranlib"
  428. break
  429. fi
  430. done
  431. IFS="$save_ifs"
  432. echo "$ac_t$result" 1>&6
  433. fi
  434. if test -n "$RANLIB"; then
  435. old_archive_cmds="$old_archive_cmds~\$RANLIB \$oldlib"
  436. old_postinstall_cmds="\$RANLIB \$oldlib~$old_postinstall_cmds"
  437. fi
  438. # Set sane defaults for `DLLTOOL', `OBJDUMP', and `AS', used on cygwin.
  439. test -z "$DLLTOOL" && DLLTOOL=dlltool
  440. test -z "$OBJDUMP" && OBJDUMP=objdump
  441. test -z "$AS" && AS=as
  442. # Check to see if we are using GCC.
  443. if test "$with_gcc" != yes || test -z "$CC"; then
  444. # If CC is not set, then try to find GCC or a usable CC.
  445. if test -z "$CC"; then
  446. echo $ac_n "checking for gcc... $ac_c" 1>&6
  447. IFS="${IFS= }"; save_ifs="$IFS"; IFS="${IFS}${PATH_SEPARATOR}"
  448. for dir in $PATH; do
  449. test -z "$dir" && dir=.
  450. if test -f $dir/gcc || test -f $dir/gcc$ac_exeext; then
  451. CC="gcc"
  452. break
  453. fi
  454. done
  455. IFS="$save_ifs"
  456. if test -n "$CC"; then
  457. echo "$ac_t$CC" 1>&6
  458. else
  459. echo "$ac_t"no 1>&6
  460. fi
  461. fi
  462. # Not "gcc", so try "cc", rejecting "/usr/ucb/cc".
  463. if test -z "$CC"; then
  464. echo $ac_n "checking for cc... $ac_c" 1>&6
  465. IFS="${IFS= }"; save_ifs="$IFS"; IFS="${IFS}${PATH_SEPARATOR}"
  466. cc_rejected=no
  467. for dir in $PATH; do
  468. test -z "$dir" && dir=.
  469. if test -f $dir/cc || test -f $dir/cc$ac_exeext; then
  470. if test "$dir/cc" = "/usr/ucb/cc"; then
  471. cc_rejected=yes
  472. continue
  473. fi
  474. CC="cc"
  475. break
  476. fi
  477. done
  478. IFS="$save_ifs"
  479. if test $cc_rejected = yes; then
  480. # We found a bogon in the path, so make sure we never use it.
  481. set dummy $CC
  482. shift
  483. if test $# -gt 0; then
  484. # We chose a different compiler from the bogus one.
  485. # However, it has the same name, so the bogon will be chosen
  486. # first if we set CC to just the name; use the full file name.
  487. shift
  488. set dummy "$dir/cc" "$@"
  489. shift
  490. CC="$@"
  491. fi
  492. fi
  493. if test -n "$CC"; then
  494. echo "$ac_t$CC" 1>&6
  495. else
  496. echo "$ac_t"no 1>&6
  497. fi
  498. if test -z "$CC"; then
  499. echo "$progname: error: no acceptable cc found in \$PATH" 1>&2
  500. exit 1
  501. fi
  502. fi
  503. # Now see if the compiler is really GCC.
  504. with_gcc=no
  505. echo $ac_n "checking whether we are using GNU C... $ac_c" 1>&6
  506. echo "$progname:581: checking whether we are using GNU C" >&5
  507. $rm conftest.c
  508. cat > conftest.c <<EOF
  509. #ifdef __GNUC__
  510. yes;
  511. #endif
  512. EOF
  513. if { ac_try='${CC-cc} -E conftest.c'; { (eval echo $progname:589: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }; } | egrep yes >/dev/null 2>&1; then
  514. with_gcc=yes
  515. fi
  516. $rm conftest.c
  517. echo "$ac_t$with_gcc" 1>&6
  518. fi
  519. # Allow CC to be a program name with arguments.
  520. set dummy $CC
  521. compiler="$2"
  522. echo $ac_n "checking for object suffix... $ac_c" 1>&6
  523. $rm conftest*
  524. echo 'int i = 1;' > conftest.c
  525. echo "$progname:603: checking for object suffix" >& 5
  526. if { (eval echo $progname:604: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>conftest.err; }; then
  527. # Append any warnings to the config.log.
  528. cat conftest.err 1>&5
  529. for ac_file in conftest.*; do
  530. case $ac_file in
  531. *.c) ;;
  532. *) objext=`echo $ac_file | sed -e s/conftest.//` ;;
  533. esac
  534. done
  535. else
  536. cat conftest.err 1>&5
  537. echo "$progname: failed program was:" >&5
  538. cat conftest.c >&5
  539. fi
  540. $rm conftest*
  541. echo "$ac_t$objext" 1>&6
  542. echo $ac_n "checking for executable suffix... $ac_c" 1>&6
  543. if eval "test \"`echo '$''{'ac_cv_exeext'+set}'`\" = set"; then
  544. echo $ac_n "(cached) $ac_c" 1>&6
  545. else
  546. ac_cv_exeext="no"
  547. $rm conftest*
  548. echo 'main () { return 0; }' > conftest.c
  549. echo "$progname:629: checking for executable suffix" >& 5
  550. if { (eval echo $progname:630: \"$ac_link\") 1>&5; (eval $ac_link) 2>conftest.err; }; then
  551. # Append any warnings to the config.log.
  552. cat conftest.err 1>&5
  553. for ac_file in conftest.*; do
  554. case $ac_file in
  555. *.c | *.err | *.$objext ) ;;
  556. *) ac_cv_exeext=.`echo $ac_file | sed -e s/conftest.//` ;;
  557. esac
  558. done
  559. else
  560. cat conftest.err 1>&5
  561. echo "$progname: failed program was:" >&5
  562. cat conftest.c >&5
  563. fi
  564. $rm conftest*
  565. fi
  566. if test "X$ac_cv_exeext" = Xno; then
  567. exeext=""
  568. else
  569. exeext="$ac_cv_exeext"
  570. fi
  571. echo "$ac_t$ac_cv_exeext" 1>&6
  572. echo $ac_n "checking for $compiler option to produce PIC... $ac_c" 1>&6
  573. pic_flag=
  574. special_shlib_compile_flags=
  575. wl=
  576. link_static_flag=
  577. no_builtin_flag=
  578. if test "$with_gcc" = yes; then
  579. wl='-Wl,'
  580. link_static_flag='-static'
  581. case "$host_os" in
  582. beos* | irix5* | irix6* | osf3* | osf4* | osf5*)
  583. # PIC is the default for these OSes.
  584. ;;
  585. aix*)
  586. # Below there is a dirty hack to force normal static linking with -ldl
  587. # The problem is because libdl dynamically linked with both libc and
  588. # libC (AIX C++ library), which obviously doesn't included in libraries
  589. # list by gcc. This cause undefined symbols with -static flags.
  590. # This hack allows C programs to be linked with "-static -ldl", but
  591. # we not sure about C++ programs.
  592. link_static_flag="$link_static_flag ${wl}-lC"
  593. ;;
  594. cygwin* | mingw* | os2*)
  595. # We can build DLLs from non-PIC.
  596. ;;
  597. amigaos*)
  598. # FIXME: we need at least 68020 code to build shared libraries, but
  599. # adding the `-m68020' flag to GCC prevents building anything better,
  600. # like `-m68040'.
  601. pic_flag='-m68020 -resident32 -malways-restore-a4'
  602. ;;
  603. sysv4*MP*)
  604. if test -d /usr/nec; then
  605. pic_flag=-Kconform_pic
  606. fi
  607. ;;
  608. *)
  609. pic_flag='-fPIC'
  610. ;;
  611. esac
  612. else
  613. # PORTME Check for PIC flags for the system compiler.
  614. case "$host_os" in
  615. aix3* | aix4*)
  616. # All AIX code is PIC.
  617. link_static_flag='-bnso -bI:/lib/syscalls.exp'
  618. ;;
  619. hpux9* | hpux10* | hpux11*)
  620. # Is there a better link_static_flag that works with the bundled CC?
  621. wl='-Wl,'
  622. link_static_flag="${wl}-a ${wl}archive"
  623. pic_flag='+Z'
  624. ;;
  625. irix5* | irix6*)
  626. wl='-Wl,'
  627. link_static_flag='-non_shared'
  628. # PIC (with -KPIC) is the default.
  629. ;;
  630. cygwin* | mingw* | os2*)
  631. # We can build DLLs from non-PIC.
  632. ;;
  633. osf3* | osf4* | osf5*)
  634. # All OSF/1 code is PIC.
  635. wl='-Wl,'
  636. link_static_flag='-non_shared'
  637. ;;
  638. sco3.2v5*)
  639. pic_flag='-Kpic'
  640. link_static_flag='-dn'
  641. special_shlib_compile_flags='-belf'
  642. ;;
  643. solaris*)
  644. pic_flag='-KPIC'
  645. link_static_flag='-Bstatic'
  646. wl='-Wl,'
  647. ;;
  648. sunos4*)
  649. pic_flag='-PIC'
  650. link_static_flag='-Bstatic'
  651. wl='-Qoption ld '
  652. ;;
  653. sysv4 | sysv4.2uw2* | sysv4.3* | sysv5*)
  654. pic_flag='-KPIC'
  655. link_static_flag='-Bstatic'
  656. wl='-Wl,'
  657. ;;
  658. uts4*)
  659. pic_flag='-pic'
  660. link_static_flag='-Bstatic'
  661. ;;
  662. sysv4*MP*)
  663. if test -d /usr/nec ;then
  664. pic_flag='-Kconform_pic'
  665. link_static_flag='-Bstatic'
  666. fi
  667. ;;
  668. *)
  669. can_build_shared=no
  670. ;;
  671. esac
  672. fi
  673. if test -n "$pic_flag"; then
  674. echo "$ac_t$pic_flag" 1>&6
  675. # Check to make sure the pic_flag actually works.
  676. echo $ac_n "checking if $compiler PIC flag $pic_flag works... $ac_c" 1>&6
  677. $rm conftest*
  678. echo "int some_variable = 0;" > conftest.c
  679. save_CFLAGS="$CFLAGS"
  680. CFLAGS="$CFLAGS $pic_flag -DPIC"
  681. echo "$progname:776: checking if $compiler PIC flag $pic_flag works" >&5
  682. if { (eval echo $progname:777: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>conftest.err; } && test -s conftest.$objext; then
  683. # Append any warnings to the config.log.
  684. cat conftest.err 1>&5
  685. case "$host_os" in
  686. hpux9* | hpux10* | hpux11*)
  687. # On HP-UX, both CC and GCC only warn that PIC is supported... then they
  688. # create non-PIC objects. So, if there were any warnings, we assume that
  689. # PIC is not supported.
  690. if test -s conftest.err; then
  691. echo "$ac_t"no 1>&6
  692. can_build_shared=no
  693. pic_flag=
  694. else
  695. echo "$ac_t"yes 1>&6
  696. pic_flag=" $pic_flag"
  697. fi
  698. ;;
  699. *)
  700. echo "$ac_t"yes 1>&6
  701. pic_flag=" $pic_flag"
  702. ;;
  703. esac
  704. else
  705. # Append any errors to the config.log.
  706. cat conftest.err 1>&5
  707. can_build_shared=no
  708. pic_flag=
  709. echo "$ac_t"no 1>&6
  710. fi
  711. CFLAGS="$save_CFLAGS"
  712. $rm conftest*
  713. else
  714. echo "$ac_t"none 1>&6
  715. fi
  716. # Check to see if options -o and -c are simultaneously supported by compiler
  717. echo $ac_n "checking if $compiler supports -c -o file.o... $ac_c" 1>&6
  718. $rm -r conftest 2>/dev/null
  719. mkdir conftest
  720. cd conftest
  721. $rm conftest*
  722. echo "int some_variable = 0;" > conftest.c
  723. mkdir out
  724. # According to Tom Tromey, Ian Lance Taylor reported there are C compilers
  725. # that will create temporary files in the current directory regardless of
  726. # the output directory. Thus, making CWD read-only will cause this test
  727. # to fail, enabling locking or at least warning the user not to do parallel
  728. # builds.
  729. chmod -w .
  730. save_CFLAGS="$CFLAGS"
  731. CFLAGS="$CFLAGS -o out/conftest2.o"
  732. echo "$progname:829: checking if $compiler supports -c -o file.o" >&5
  733. if { (eval echo $progname:830: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>out/conftest.err; } && test -s out/conftest2.o; then
  734. # The compiler can only warn and ignore the option if not recognized
  735. # So say no if there are warnings
  736. if test -s out/conftest.err; then
  737. echo "$ac_t"no 1>&6
  738. compiler_c_o=no
  739. else
  740. echo "$ac_t"yes 1>&6
  741. compiler_c_o=yes
  742. fi
  743. else
  744. # Append any errors to the config.log.
  745. cat out/conftest.err 1>&5
  746. compiler_c_o=no
  747. echo "$ac_t"no 1>&6
  748. fi
  749. CFLAGS="$save_CFLAGS"
  750. chmod u+w .
  751. $rm conftest* out/*
  752. rmdir out
  753. cd ..
  754. rmdir conftest
  755. $rm -r conftest 2>/dev/null
  756. if test x"$compiler_c_o" = x"yes"; then
  757. # Check to see if we can write to a .lo
  758. echo $ac_n "checking if $compiler supports -c -o file.lo... $ac_c" 1>&6
  759. $rm conftest*
  760. echo "int some_variable = 0;" > conftest.c
  761. save_CFLAGS="$CFLAGS"
  762. CFLAGS="$CFLAGS -c -o conftest.lo"
  763. echo "$progname:862: checking if $compiler supports -c -o file.lo" >&5
  764. if { (eval echo $progname:863: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>conftest.err; } && test -s conftest.lo; then
  765. # The compiler can only warn and ignore the option if not recognized
  766. # So say no if there are warnings
  767. if test -s conftest.err; then
  768. echo "$ac_t"no 1>&6
  769. compiler_o_lo=no
  770. else
  771. echo "$ac_t"yes 1>&6
  772. compiler_o_lo=yes
  773. fi
  774. else
  775. # Append any errors to the config.log.
  776. cat conftest.err 1>&5
  777. compiler_o_lo=no
  778. echo "$ac_t"no 1>&6
  779. fi
  780. CFLAGS="$save_CFLAGS"
  781. $rm conftest*
  782. else
  783. compiler_o_lo=no
  784. fi
  785. # Check to see if we can do hard links to lock some files if needed
  786. hard_links="nottested"
  787. if test "$compiler_c_o" = no && test "$need_locks" != no; then
  788. # do not overwrite the value of need_locks provided by the user
  789. echo $ac_n "checking if we can lock with hard links... $ac_c" 1>&6
  790. hard_links=yes
  791. $rm conftest*
  792. ln conftest.a conftest.b 2>/dev/null && hard_links=no
  793. touch conftest.a
  794. ln conftest.a conftest.b 2>&5 || hard_links=no
  795. ln conftest.a conftest.b 2>/dev/null && hard_links=no
  796. echo "$ac_t$hard_links" 1>&6
  797. $rm conftest*
  798. if test "$hard_links" = no; then
  799. echo "*** WARNING: \`$CC' does not support \`-c -o', so \`make -j' may be unsafe" >&2
  800. need_locks=warn
  801. fi
  802. else
  803. need_locks=no
  804. fi
  805. if test "$with_gcc" = yes; then
  806. # Check to see if options -fno-rtti -fno-exceptions are supported by compiler
  807. echo $ac_n "checking if $compiler supports -fno-rtti -fno-exceptions ... $ac_c" 1>&6
  808. $rm conftest*
  809. echo "int some_variable = 0;" > conftest.c
  810. save_CFLAGS="$CFLAGS"
  811. CFLAGS="$CFLAGS -fno-rtti -fno-exceptions -c conftest.c"
  812. echo "$progname:914: checking if $compiler supports -fno-rtti -fno-exceptions" >&5
  813. if { (eval echo $progname:915: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>conftest.err; } && test -s conftest.o; then
  814. # The compiler can only warn and ignore the option if not recognized
  815. # So say no if there are warnings
  816. if test -s conftest.err; then
  817. echo "$ac_t"no 1>&6
  818. compiler_rtti_exceptions=no
  819. else
  820. echo "$ac_t"yes 1>&6
  821. compiler_rtti_exceptions=yes
  822. fi
  823. else
  824. # Append any errors to the config.log.
  825. cat conftest.err 1>&5
  826. compiler_rtti_exceptions=no
  827. echo "$ac_t"no 1>&6
  828. fi
  829. CFLAGS="$save_CFLAGS"
  830. $rm conftest*
  831. if test "$compiler_rtti_exceptions" = "yes"; then
  832. no_builtin_flag=' -fno-builtin -fno-rtti -fno-exceptions'
  833. else
  834. no_builtin_flag=' -fno-builtin'
  835. fi
  836. fi
  837. # Check for any special shared library compilation flags.
  838. if test -n "$special_shlib_compile_flags"; then
  839. echo "$progname: warning: \`$CC' requires \`$special_shlib_compile_flags' to build shared libraries" 1>&2
  840. if echo "$old_CC $old_CFLAGS " | egrep -e "[ ]$special_shlib_compile_flags[ ]" >/dev/null; then :
  841. else
  842. echo "$progname: add \`$special_shlib_compile_flags' to the CC or CFLAGS env variable and reconfigure" 1>&2
  843. can_build_shared=no
  844. fi
  845. fi
  846. echo $ac_n "checking if $compiler static flag $link_static_flag works... $ac_c" 1>&6
  847. $rm conftest*
  848. echo 'main(){return(0);}' > conftest.c
  849. save_LDFLAGS="$LDFLAGS"
  850. LDFLAGS="$LDFLAGS $link_static_flag"
  851. echo "$progname:958: checking if $compiler static flag $link_static_flag works" >&5
  852. if { (eval echo $progname:959: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest; then
  853. echo "$ac_t$link_static_flag" 1>&6
  854. else
  855. echo "$ac_t"none 1>&6
  856. link_static_flag=
  857. fi
  858. LDFLAGS="$save_LDFLAGS"
  859. $rm conftest*
  860. if test -z "$LN_S"; then
  861. # Check to see if we can use ln -s, or we need hard links.
  862. echo $ac_n "checking whether ln -s works... $ac_c" 1>&6
  863. $rm conftest.dat
  864. if ln -s X conftest.dat 2>/dev/null; then
  865. $rm conftest.dat
  866. LN_S="ln -s"
  867. else
  868. LN_S=ln
  869. fi
  870. if test "$LN_S" = "ln -s"; then
  871. echo "$ac_t"yes 1>&6
  872. else
  873. echo "$ac_t"no 1>&6
  874. fi
  875. fi
  876. # Make sure LD is an absolute path.
  877. if test -z "$LD"; then
  878. ac_prog=ld
  879. if test "$with_gcc" = yes; then
  880. # Check if gcc -print-prog-name=ld gives a path.
  881. echo $ac_n "checking for ld used by GCC... $ac_c" 1>&6
  882. echo "$progname:991: checking for ld used by GCC" >&5
  883. ac_prog=`($CC -print-prog-name=ld) 2>&5`
  884. case "$ac_prog" in
  885. # Accept absolute paths.
  886. [\\/]* | [A-Za-z]:[\\/]*)
  887. re_direlt='/[^/][^/]*/\.\./'
  888. # Canonicalize the path of ld
  889. ac_prog=`echo $ac_prog| sed 's%\\\\%/%g'`
  890. while echo $ac_prog | grep "$re_direlt" > /dev/null 2>&1; do
  891. ac_prog=`echo $ac_prog| sed "s%$re_direlt%/%"`
  892. done
  893. test -z "$LD" && LD="$ac_prog"
  894. ;;
  895. "")
  896. # If it fails, then pretend we are not using GCC.
  897. ac_prog=ld
  898. ;;
  899. *)
  900. # If it is relative, then search for the first ld in PATH.
  901. with_gnu_ld=unknown
  902. ;;
  903. esac
  904. elif test "$with_gnu_ld" = yes; then
  905. echo $ac_n "checking for GNU ld... $ac_c" 1>&6
  906. echo "$progname:1015: checking for GNU ld" >&5
  907. else
  908. echo $ac_n "checking for non-GNU ld""... $ac_c" 1>&6
  909. echo "$progname:1018: checking for non-GNU ld" >&5
  910. fi
  911. if test -z "$LD"; then
  912. IFS="${IFS= }"; ac_save_ifs="$IFS"; IFS="${IFS}${PATH_SEPARATOR}"
  913. for ac_dir in $PATH; do
  914. test -z "$ac_dir" && ac_dir=.
  915. if test -f "$ac_dir/$ac_prog" || test -f "$ac_dir/$ac_prog$ac_exeext"; then
  916. LD="$ac_dir/$ac_prog"
  917. # Check to see if the program is GNU ld. I'd rather use --version,
  918. # but apparently some GNU ld's only accept -v.
  919. # Break only if it was the GNU/non-GNU ld that we prefer.
  920. if "$LD" -v 2>&1 < /dev/null | egrep '(GNU|with BFD)' > /dev/null; then
  921. test "$with_gnu_ld" != no && break
  922. else
  923. test "$with_gnu_ld" != yes && break
  924. fi
  925. fi
  926. done
  927. IFS="$ac_save_ifs"
  928. fi
  929. if test -n "$LD"; then
  930. echo "$ac_t$LD" 1>&6
  931. else
  932. echo "$ac_t"no 1>&6
  933. fi
  934. if test -z "$LD"; then
  935. echo "$progname: error: no acceptable ld found in \$PATH" 1>&2
  936. exit 1
  937. fi
  938. fi
  939. # Check to see if it really is or is not GNU ld.
  940. echo $ac_n "checking if the linker ($LD) is GNU ld... $ac_c" 1>&6
  941. # I'd rather use --version here, but apparently some GNU ld's only accept -v.
  942. if $LD -v 2>&1 </dev/null | egrep '(GNU|with BFD)' 1>&5; then
  943. with_gnu_ld=yes
  944. else
  945. with_gnu_ld=no
  946. fi
  947. echo "$ac_t$with_gnu_ld" 1>&6
  948. # See if the linker supports building shared libraries.
  949. echo $ac_n "checking whether the linker ($LD) supports shared libraries... $ac_c" 1>&6
  950. allow_undefined_flag=
  951. no_undefined_flag=
  952. need_lib_prefix=unknown
  953. need_version=unknown
  954. # when you set need_version to no, make sure it does not cause -set_version
  955. # flags to be left without arguments
  956. archive_cmds=
  957. archive_expsym_cmds=
  958. old_archive_from_new_cmds=
  959. export_dynamic_flag_spec=
  960. whole_archive_flag_spec=
  961. thread_safe_flag_spec=
  962. hardcode_libdir_flag_spec=
  963. hardcode_libdir_separator=
  964. hardcode_direct=no
  965. hardcode_minus_L=no
  966. hardcode_shlibpath_var=unsupported
  967. runpath_var=
  968. always_export_symbols=no
  969. export_symbols_cmds='$NM $libobjs $convenience | $global_symbol_pipe | sed '\''s/.* //'\'' | sort | uniq > $export_symbols'
  970. # include_expsyms should be a list of space-separated symbols to be *always*
  971. # included in the symbol list
  972. include_expsyms=
  973. # exclude_expsyms can be an egrep regular expression of symbols to exclude
  974. # it will be wrapped by ` (' and `)$', so one must not match beginning or
  975. # end of line. Example: `a|bc|.*d.*' will exclude the symbols `a' and `bc',
  976. # as well as any symbol that contains `d'.
  977. exclude_expsyms="_GLOBAL_OFFSET_TABLE_"
  978. # Although _GLOBAL_OFFSET_TABLE_ is a valid symbol C name, most a.out
  979. # platforms (ab)use it in PIC code, but their linkers get confused if
  980. # the symbol is explicitly referenced. Since portable code cannot
  981. # rely on this symbol name, it's probably fine to never include it in
  982. # preloaded symbol tables.
  983. case "$host_os" in
  984. cygwin* | mingw*)
  985. # FIXME: the MSVC++ port hasn't been tested in a loooong time
  986. # When not using gcc, we currently assume that we are using
  987. # Microsoft Visual C++.
  988. if test "$with_gcc" != yes; then
  989. with_gnu_ld=no
  990. fi
  991. ;;
  992. esac
  993. ld_shlibs=yes
  994. if test "$with_gnu_ld" = yes; then
  995. # If archive_cmds runs LD, not CC, wlarc should be empty
  996. wlarc='${wl}'
  997. # See if GNU ld supports shared libraries.
  998. case "$host_os" in
  999. aix3* | aix4*)
  1000. # On AIX, the GNU linker is very broken
  1001. ld_shlibs=no
  1002. cat <<EOF 1>&2
  1003. *** Warning: the GNU linker, at least up to release 2.9.1, is reported
  1004. *** to be unable to reliably create shared libraries on AIX.
  1005. *** Therefore, libtool is disabling shared libraries support. If you
  1006. *** really care for shared libraries, you may want to modify your PATH
  1007. *** so that a non-GNU linker is found, and then restart.
  1008. EOF
  1009. ;;
  1010. amigaos*)
  1011. archive_cmds='$rm $objdir/a2ixlibrary.data~$echo "#define NAME $libname" > $objdir/a2ixlibrary.data~$echo "#define LIBRARY_ID 1" >> $objdir/a2ixlibrary.data~$echo "#define VERSION $major" >> $objdir/a2ixlibrary.data~$echo "#define REVISION $revision" >> $objdir/a2ixlibrary.data~$AR cru $lib $libobjs~$RANLIB $lib~(cd $objdir && a2ixlibrary -32)'
  1012. hardcode_libdir_flag_spec='-L$libdir'
  1013. hardcode_minus_L=yes
  1014. # Samuel A. Falvo II <kc5tja@dolphin.openprojects.net> reports
  1015. # that the semantics of dynamic libraries on AmigaOS, at least up
  1016. # to version 4, is to share data among multiple programs linked
  1017. # with the same dynamic library. Since this doesn't match the
  1018. # behavior of shared libraries on other platforms, we can use
  1019. # them.
  1020. ld_shlibs=no
  1021. ;;
  1022. beos*)
  1023. if $LD --help 2>&1 | egrep ': supported targets:.* elf' > /dev/null; then
  1024. allow_undefined_flag=unsupported
  1025. # Joseph Beckenbach <jrb3@best.com> says some releases of gcc
  1026. # support --undefined. This deserves some investigation. FIXME
  1027. archive_cmds='$CC -nostart $libobjs $deplibs $linkopts ${wl}-soname $wl$soname -o $lib'
  1028. else
  1029. ld_shlibs=no
  1030. fi
  1031. ;;
  1032. cygwin* | mingw*)
  1033. # hardcode_libdir_flag_spec is actually meaningless, as there is
  1034. # no search path for DLLs.
  1035. hardcode_libdir_flag_spec='-L$libdir'
  1036. allow_undefined_flag=unsupported
  1037. always_export_symbols=yes
  1038. # Extract the symbol export list from an `--export-all' def file,
  1039. # then regenerate the def file from the symbol export list, so that
  1040. # the compiled dll only exports the symbol export list.
  1041. # Be careful not to strip the DATA tag left by newer dlltools.
  1042. export_symbols_cmds='test -f $objdir/$soname-ltdll.c || sed -e "/^# \/\* ltdll\.c starts here \*\//,/^# \/\* ltdll.c ends here \*\// { s/^# //; p; }" -e d < $0 > $objdir/$soname-ltdll.c~
  1043. test -f $objdir/$soname-ltdll.$objext || (cd $objdir && $CC -c $soname-ltdll.c)~
  1044. $DLLTOOL --export-all --exclude-symbols DllMain@12,_cygwin_dll_entry@12,_cygwin_noncygwin_dll_entry@12 --output-def $objdir/$soname-def $objdir/$soname-ltdll.$objext $libobjs $convenience~
  1045. sed -e "1,/EXPORTS/d" -e "s/ @ [0-9]*//" -e "s/ *;.*$//" < $objdir/$soname-def > $export_symbols'
  1046. # If DATA tags from a recent dlltool are present, honour them!
  1047. archive_expsym_cmds='echo EXPORTS > $objdir/$soname-def~
  1048. _lt_hint=1;
  1049. cat $export_symbols | while read symbol; do
  1050. set dummy \$symbol;
  1051. case \$# in
  1052. 2) echo " \$2 @ \$_lt_hint ; " >> $objdir/$soname-def;;
  1053. *) echo " \$2 @ \$_lt_hint \$3 ; " >> $objdir/$soname-def;;
  1054. esac;
  1055. _lt_hint=`expr 1 + \$_lt_hint`;
  1056. done~
  1057. test -f $objdir/$soname-ltdll.c || sed -e "/^# \/\* ltdll\.c starts here \*\//,/^# \/\* ltdll.c ends here \*\// { s/^# //; p; }" -e d < $0 > $objdir/$soname-ltdll.c~
  1058. test -f $objdir/$soname-ltdll.$objext || (cd $objdir && $CC -c $soname-ltdll.c)~
  1059. $CC -Wl,--base-file,$objdir/$soname-base -Wl,--dll -nostartfiles -Wl,-e,__cygwin_dll_entry@12 -o $lib $objdir/$soname-ltdll.$objext $libobjs $deplibs $linkopts~
  1060. $DLLTOOL --as=$AS --dllname $soname --exclude-symbols DllMain@12,_cygwin_dll_entry@12,_cygwin_noncygwin_dll_entry@12 --def $objdir/$soname-def --base-file $objdir/$soname-base --output-exp $objdir/$soname-exp~
  1061. $CC -Wl,--base-file,$objdir/$soname-base $objdir/$soname-exp -Wl,--dll -nostartfiles -Wl,-e,__cygwin_dll_entry@12 -o $lib $objdir/$soname-ltdll.$objext $libobjs $deplibs $linkopts~
  1062. $DLLTOOL --as=$AS --dllname $soname --exclude-symbols DllMain@12,_cygwin_dll_entry@12,_cygwin_noncygwin_dll_entry@12 --def $objdir/$soname-def --base-file $objdir/$soname-base --output-exp $objdir/$soname-exp~
  1063. $CC $objdir/$soname-exp -Wl,--dll -nostartfiles -Wl,-e,__cygwin_dll_entry@12 -o $lib $objdir/$soname-ltdll.$objext $libobjs $deplibs $linkopts'
  1064. old_archive_from_new_cmds='$DLLTOOL --as=$AS --dllname $soname --def $objdir/$soname-def --output-lib $objdir/$libname.a'
  1065. ;;
  1066. netbsd*)
  1067. if echo __ELF__ | $CC -E - | grep __ELF__ >/dev/null; then
  1068. archive_cmds='$CC -shared $libobjs $deplibs $linkopts ${wl}-soname $wl$soname -o $lib'
  1069. archive_expsym_cmds='$CC -shared $libobjs $deplibs $linkopts ${wl}-soname $wl$soname ${wl}-retain-symbols-file $wl$export_symbols -o $lib'
  1070. else
  1071. archive_cmds='$LD -Bshareable $libobjs $deplibs $linkopts -o $lib'
  1072. # can we support soname and/or expsyms with a.out? -oliva
  1073. fi
  1074. ;;
  1075. solaris* | sysv5*)
  1076. if $LD -v 2>&1 | egrep 'BFD 2\.8' > /dev/null; then
  1077. ld_shlibs=no
  1078. cat <<EOF 1>&2
  1079. *** Warning: The releases 2.8.* of the GNU linker cannot reliably
  1080. *** create shared libraries on Solaris systems. Therefore, libtool
  1081. *** is disabling shared libraries support. We urge you to upgrade GNU
  1082. *** binutils to release 2.9.1 or newer. Another option is to modify
  1083. *** your PATH or compiler configuration so that the native linker is
  1084. *** used, and then restart.
  1085. EOF
  1086. elif $LD --help 2>&1 | egrep ': supported targets:.* elf' > /dev/null; then
  1087. archive_cmds='$CC -shared $libobjs $deplibs $linkopts ${wl}-soname $wl$soname -o $lib'
  1088. archive_expsym_cmds='$CC -shared $libobjs $deplibs $linkopts ${wl}-soname $wl$soname ${wl}-retain-symbols-file $wl$export_symbols -o $lib'
  1089. else
  1090. ld_shlibs=no
  1091. fi
  1092. ;;
  1093. sunos4*)
  1094. archive_cmds='$LD -assert pure-text -Bshareable -o $lib $libobjs $deplibs $linkopts'
  1095. wlarc=
  1096. hardcode_direct=yes
  1097. hardcode_shlibpath_var=no
  1098. ;;
  1099. *)
  1100. if $LD --help 2>&1 | egrep ': supported targets:.* elf' > /dev/null; then
  1101. archive_cmds='$CC -shared $libobjs $deplibs $linkopts ${wl}-soname $wl$soname -o $lib'
  1102. archive_expsym_cmds='$CC -shared $libobjs $deplibs $linkopts ${wl}-soname $wl$soname ${wl}-retain-symbols-file $wl$export_symbols -o $lib'
  1103. else
  1104. ld_shlibs=no
  1105. fi
  1106. ;;
  1107. esac
  1108. if test "$ld_shlibs" = yes; then
  1109. runpath_var=LD_RUN_PATH
  1110. hardcode_libdir_flag_spec='${wl}--rpath ${wl}$libdir'
  1111. export_dynamic_flag_spec='${wl}--export-dynamic'
  1112. case $host_os in
  1113. cygwin* | mingw*)
  1114. # dlltool doesn't understand --whole-archive et. al.
  1115. whole_archive_flag_spec=
  1116. ;;
  1117. *)
  1118. # ancient GNU ld didn't support --whole-archive et. al.
  1119. if $LD --help 2>&1 | egrep 'no-whole-archive' > /dev/null; then
  1120. whole_archive_flag_spec="$wlarc"'--whole-archive$convenience '"$wlarc"'--no-whole-archive'
  1121. else
  1122. whole_archive_flag_spec=
  1123. fi
  1124. ;;
  1125. esac
  1126. fi
  1127. else
  1128. # PORTME fill in a description of your system's linker (not GNU ld)
  1129. case "$host_os" in
  1130. aix3*)
  1131. allow_undefined_flag=unsupported
  1132. always_export_symbols=yes
  1133. archive_expsym_cmds='$LD -o $objdir/$soname $libobjs $deplibs $linkopts -bE:$export_symbols -T512 -H512 -bM:SRE~$AR cru $lib $objdir/$soname'
  1134. # Note: this linker hardcodes the directories in LIBPATH if there
  1135. # are no directories specified by -L.
  1136. hardcode_minus_L=yes
  1137. if test "$with_gcc" = yes && test -z "$link_static_flag"; then
  1138. # Neither direct hardcoding nor static linking is supported with a
  1139. # broken collect2.
  1140. hardcode_direct=unsupported
  1141. fi
  1142. ;;
  1143. aix4*)
  1144. hardcode_libdir_flag_spec='${wl}-b ${wl}nolibpath ${wl}-b ${wl}libpath:$libdir:/usr/lib:/lib'
  1145. hardcode_libdir_separator=':'
  1146. if test "$with_gcc" = yes; then
  1147. collect2name=`${CC} -print-prog-name=collect2`
  1148. if test -f "$collect2name" && \
  1149. strings "$collect2name" | grep resolve_lib_name >/dev/null
  1150. then
  1151. # We have reworked collect2
  1152. hardcode_direct=yes
  1153. else
  1154. # We have old collect2
  1155. hardcode_direct=unsupported
  1156. # It fails to find uninstalled libraries when the uninstalled
  1157. # path is not listed in the libpath. Setting hardcode_minus_L
  1158. # to unsupported forces relinking
  1159. hardcode_minus_L=yes
  1160. hardcode_libdir_flag_spec='-L$libdir'
  1161. hardcode_libdir_separator=
  1162. fi
  1163. shared_flag='-shared'
  1164. else
  1165. shared_flag='${wl}-bM:SRE'
  1166. hardcode_direct=yes
  1167. fi
  1168. allow_undefined_flag=' ${wl}-berok'
  1169. archive_cmds="\$CC $shared_flag"' -o $objdir/$soname $libobjs $deplibs $linkopts ${wl}-bexpall ${wl}-bnoentry${allow_undefined_flag}'
  1170. archive_expsym_cmds="\$CC $shared_flag"' -o $objdir/$soname $libobjs $deplibs $linkopts ${wl}-bE:$export_symbols ${wl}-bnoentry${allow_undefined_flag}'
  1171. case "$host_os" in aix4.[01]|aix4.[01].*)
  1172. # According to Greg Wooledge, -bexpall is only supported from AIX 4.2 on
  1173. always_export_symbols=yes ;;
  1174. esac
  1175. ;;
  1176. amigaos*)
  1177. archive_cmds='$rm $objdir/a2ixlibrary.data~$echo "#define NAME $libname" > $objdir/a2ixlibrary.data~$echo "#define LIBRARY_ID 1" >> $objdir/a2ixlibrary.data~$echo "#define VERSION $major" >> $objdir/a2ixlibrary.data~$echo "#define REVISION $revision" >> $objdir/a2ixlibrary.data~$AR cru $lib $libobjs~$RANLIB $lib~(cd $objdir && a2ixlibrary -32)'
  1178. hardcode_libdir_flag_spec='-L$libdir'
  1179. hardcode_minus_L=yes
  1180. # see comment about different semantics on the GNU ld section
  1181. ld_shlibs=no
  1182. ;;
  1183. cygwin* | mingw*)
  1184. # When not using gcc, we currently assume that we are using
  1185. # Microsoft Visual C++.
  1186. # hardcode_libdir_flag_spec is actually meaningless, as there is
  1187. # no search path for DLLs.
  1188. hardcode_libdir_flag_spec=' '
  1189. allow_undefined_flag=unsupported
  1190. # Tell ltmain to make .lib files, not .a files.
  1191. libext=lib
  1192. # FIXME: Setting linknames here is a bad hack.
  1193. archive_cmds='$CC -o $lib $libobjs $linkopts `echo "$deplibs" | sed -e '\''s/ -lc$//'\''` -link -dll~linknames='
  1194. # The linker will automatically build a .lib file if we build a DLL.
  1195. old_archive_from_new_cmds='true'
  1196. # FIXME: Should let the user specify the lib program.
  1197. old_archive_cmds='lib /OUT:$oldlib$oldobjs'
  1198. fix_srcfile_path='`cygpath -w $srcfile`'
  1199. ;;
  1200. freebsd1*)
  1201. ld_shlibs=no
  1202. ;;
  1203. # FreeBSD 2.2.[012] allows us to include c++rt0.o to get C++ constructor
  1204. # support. Future versions do this automatically, but an explicit c++rt0.o
  1205. # does not break anything, and helps significantly (at the cost of a little
  1206. # extra space).
  1207. freebsd2.2*)
  1208. archive_cmds='$LD -Bshareable -o $lib $libobjs $deplibs $linkopts /usr/lib/c++rt0.o'
  1209. hardcode_libdir_flag_spec='-R$libdir'
  1210. hardcode_direct=yes
  1211. hardcode_shlibpath_var=no
  1212. ;;
  1213. # Unfortunately, older versions of FreeBSD 2 do not have this feature.
  1214. freebsd2*)
  1215. archive_cmds='$LD -Bshareable -o $lib $libobjs $deplibs $linkopts'
  1216. hardcode_direct=yes
  1217. hardcode_minus_L=yes
  1218. hardcode_shlibpath_var=no
  1219. ;;
  1220. # FreeBSD 3 and greater uses gcc -shared to do shared libraries.
  1221. freebsd*)
  1222. archive_cmds='$CC -shared -o $lib $libobjs $deplibs $linkopts'
  1223. hardcode_libdir_flag_spec='-R$libdir'
  1224. hardcode_direct=yes
  1225. hardcode_shlibpath_var=no
  1226. ;;
  1227. hpux9* | hpux10* | hpux11*)
  1228. case "$host_os" in
  1229. hpux9*) archive_cmds='$rm $objdir/$soname~$LD -b +b $install_libdir -o $objdir/$soname $libobjs $deplibs $linkopts~test $objdir/$soname = $lib || mv $objdir/$soname $lib' ;;
  1230. *) archive_cmds='$LD -b +h $soname +b $install_libdir -o $lib $libobjs $deplibs $linkopts' ;;
  1231. esac
  1232. hardcode_libdir_flag_spec='${wl}+b ${wl}$libdir'
  1233. hardcode_libdir_separator=:
  1234. hardcode_direct=yes
  1235. hardcode_minus_L=yes # Not in the search PATH, but as the default
  1236. # location of the library.
  1237. export_dynamic_flag_spec='${wl}-E'
  1238. ;;
  1239. irix5* | irix6*)
  1240. if test "$with_gcc" = yes; then
  1241. archive_cmds='$CC -shared $libobjs $deplibs $linkopts ${wl}-soname ${wl}$soname `test -n "$verstring" && echo ${wl}-set_version ${wl}$verstring` ${wl}-update_registry ${wl}${objdir}/so_locations -o $lib'
  1242. else
  1243. archive_cmds='$LD -shared $libobjs $deplibs $linkopts -soname $soname `test -n "$verstring" && echo -set_version $verstring` -update_registry ${objdir}/so_locations -o $lib'
  1244. fi
  1245. hardcode_libdir_flag_spec='${wl}-rpath ${wl}$libdir'
  1246. hardcode_libdir_separator=:
  1247. ;;
  1248. netbsd*)
  1249. if echo __ELF__ | $CC -E - | grep __ELF__ >/dev/null; then
  1250. archive_cmds='$LD -Bshareable -o $lib $libobjs $deplibs $linkopts' # a.out
  1251. else
  1252. archive_cmds='$LD -shared -o $lib $libobjs $deplibs $linkopts' # ELF
  1253. fi
  1254. hardcode_libdir_flag_spec='${wl}-R$libdir'
  1255. hardcode_direct=yes
  1256. hardcode_shlibpath_var=no
  1257. ;;
  1258. openbsd*)
  1259. archive_cmds='$LD -Bshareable -o $lib $libobjs $deplibs $linkopts'
  1260. hardcode_libdir_flag_spec='-R$libdir'
  1261. hardcode_direct=yes
  1262. hardcode_shlibpath_var=no
  1263. ;;
  1264. os2*)
  1265. hardcode_libdir_flag_spec='-L$libdir'
  1266. hardcode_minus_L=yes
  1267. allow_undefined_flag=unsupported
  1268. archive_cmds='$echo "LIBRARY $libname INITINSTANCE" > $objdir/$libname.def~$echo "DESCRIPTION \"$libname\"" >> $objdir/$libname.def~$echo DATA >> $objdir/$libname.def~$echo " SINGLE NONSHARED" >> $objdir/$libname.def~$echo EXPORTS >> $objdir/$libname.def~emxexp $libobjs >> $objdir/$libname.def~$CC -Zdll -Zcrtdll -o $lib $libobjs $deplibs $linkopts $objdir/$libname.def'
  1269. old_archive_from_new_cmds='emximp -o $objdir/$libname.a $objdir/$libname.def'
  1270. ;;
  1271. osf3*)
  1272. if test "$with_gcc" = yes; then
  1273. allow_undefined_flag=' ${wl}-expect_unresolved ${wl}\*'
  1274. archive_cmds='$CC -shared${allow_undefined_flag} $libobjs $deplibs $linkopts ${wl}-soname ${wl}$soname `test -n "$verstring" && echo ${wl}-set_version ${wl}$verstring` ${wl}-update_registry ${wl}${objdir}/so_locations -o $lib'
  1275. else
  1276. allow_undefined_flag=' -expect_unresolved \*'
  1277. archive_cmds='$LD -shared${allow_undefined_flag} $libobjs $deplibs $linkopts -soname $soname `test -n "$verstring" && echo -set_version $verstring` -update_registry ${objdir}/so_locations -o $lib'
  1278. fi
  1279. hardcode_libdir_flag_spec='${wl}-rpath ${wl}$libdir'
  1280. hardcode_libdir_separator=:
  1281. ;;
  1282. osf4* | osf5*) # As osf3* with the addition of the -msym flag
  1283. if test "$with_gcc" = yes; then
  1284. allow_undefined_flag=' ${wl}-expect_unresolved ${wl}\*'
  1285. archive_cmds='$CC -shared${allow_undefined_flag} $libobjs $deplibs $linkopts ${wl}-msym ${wl}-soname ${wl}$soname `test -n "$verstring" && echo ${wl}-set_version ${wl}$verstring` ${wl}-update_registry ${wl}${objdir}/so_locations -o $lib'
  1286. else
  1287. allow_undefined_flag=' -expect_unresolved \*'
  1288. archive_cmds='$LD -shared${allow_undefined_flag} $libobjs $deplibs $linkopts -msym -soname $soname `test -n "$verstring" && echo -set_version $verstring` -update_registry ${objdir}/so_locations -o $lib'
  1289. fi
  1290. hardcode_libdir_flag_spec='${wl}-rpath ${wl}$libdir'
  1291. hardcode_libdir_separator=:
  1292. ;;
  1293. rhapsody*)
  1294. archive_cmds='$CC -bundle -undefined suppress -o $lib $libobjs $deplibs $linkopts'
  1295. hardcode_libdir_flags_spec='-L$libdir'
  1296. hardcode_direct=yes
  1297. hardcode_shlibpath_var=no
  1298. ;;
  1299. sco3.2v5*)
  1300. archive_cmds='$LD -G -h $soname -o $lib $libobjs $deplibs $linkopts'
  1301. hardcode_shlibpath_var=no
  1302. runpath_var=LD_RUN_PATH
  1303. hardcode_runpath_var=yes
  1304. ;;
  1305. solaris*)
  1306. no_undefined_flag=' -z text'
  1307. # $CC -shared without GNU ld will not create a library from C++
  1308. # object files and a static libstdc++, better avoid it by now
  1309. archive_cmds='$LD -G${allow_undefined_flag} -h $soname -o $lib $libobjs $deplibs $linkopts'
  1310. archive_expsym_cmds='$echo "{ global:" > $lib.exp~cat $export_symbols | sed -e "s/\(.*\)/\1;/" >> $lib.exp~$echo "local: *; };" >> $lib.exp~
  1311. $LD -G${allow_undefined_flag} -M $lib.exp -h $soname -o $lib $libobjs $deplibs $linkopts~$rm $lib.exp'
  1312. hardcode_libdir_flag_spec='-R$libdir'
  1313. hardcode_shlibpath_var=no
  1314. case "$host_os" in
  1315. solaris2.[0-5] | solaris2.[0-5].*) ;;
  1316. *) # Supported since Solaris 2.6 (maybe 2.5.1?)
  1317. whole_archive_flag_spec='-z allextract$convenience -z defaultextract' ;;
  1318. esac
  1319. ;;
  1320. sunos4*)
  1321. archive_cmds='$LD -assert pure-text -Bstatic -o $lib $libobjs $deplibs $linkopts'
  1322. hardcode_libdir_flag_spec='-L$libdir'
  1323. hardcode_direct=yes
  1324. hardcode_minus_L=yes
  1325. hardcode_shlibpath_var=no
  1326. ;;
  1327. sysv4)
  1328. if test "x$host_vendor" = xsequent; then
  1329. # Use $CC to link under sequent, because it throws in some extra .o
  1330. # files that make .init and .fini sections work.
  1331. archive_cmds='$CC -G ${wl}-h $soname -o $lib $libobjs $deplibs $linkopts'
  1332. else
  1333. archive_cmds='$LD -G -h $soname -o $lib $libobjs $deplibs $linkopts'
  1334. fi
  1335. runpath_var='LD_RUN_PATH'
  1336. hardcode_shlibpath_var=no
  1337. hardcode_direct=no #Motorola manual says yes, but my tests say they lie
  1338. ;;
  1339. sysv4.3*)
  1340. archive_cmds='$LD -G -h $soname -o $lib $libobjs $deplibs $linkopts'
  1341. hardcode_shlibpath_var=no
  1342. export_dynamic_flag_spec='-Bexport'
  1343. ;;
  1344. sysv5*)
  1345. no_undefined_flag=' -z text'
  1346. # $CC -shared without GNU ld will not create a library from C++
  1347. # object files and a static libstdc++, better avoid it by now
  1348. archive_cmds='$LD -G${allow_undefined_flag} -h $soname -o $lib $libobjs $deplibs $linkopts'
  1349. archive_expsym_cmds='$echo "{ global:" > $lib.exp~cat $export_symbols | sed -e "s/\(.*\)/\1;/" >> $lib.exp~$echo "local: *; };" >> $lib.exp~
  1350. $LD -G${allow_undefined_flag} -M $lib.exp -h $soname -o $lib $libobjs $deplibs $linkopts~$rm $lib.exp'
  1351. hardcode_libdir_flag_spec=
  1352. hardcode_shlibpath_var=no
  1353. runpath_var='LD_RUN_PATH'
  1354. ;;
  1355. uts4*)
  1356. archive_cmds='$LD -G -h $soname -o $lib $libobjs $deplibs $linkopts'
  1357. hardcode_libdir_flag_spec='-L$libdir'
  1358. hardcode_shlibpath_var=no
  1359. ;;
  1360. dgux*)
  1361. archive_cmds='$LD -G -h $soname -o $lib $libobjs $deplibs $linkopts'
  1362. hardcode_libdir_flag_spec='-L$libdir'
  1363. hardcode_shlibpath_var=no
  1364. ;;
  1365. sysv4*MP*)
  1366. if test -d /usr/nec; then
  1367. archive_cmds='$LD -G -h $soname -o $lib $libobjs $deplibs $linkopts'
  1368. hardcode_shlibpath_var=no
  1369. runpath_var=LD_RUN_PATH
  1370. hardcode_runpath_var=yes
  1371. ld_shlibs=yes
  1372. fi
  1373. ;;
  1374. sysv4.2uw2*)
  1375. archive_cmds='$LD -G -o $lib $libobjs $deplibs $linkopts'
  1376. hardcode_direct=yes
  1377. hardcode_minus_L=no
  1378. hardcode_shlibpath_var=no
  1379. hardcode_runpath_var=yes
  1380. runpath_var=LD_RUN_PATH
  1381. ;;
  1382. unixware7*)
  1383. archive_cmds='$LD -G -h $soname -o $lib $libobjs $deplibs $linkopts'
  1384. runpath_var='LD_RUN_PATH'
  1385. hardcode_shlibpath_var=no
  1386. ;;
  1387. *)
  1388. ld_shlibs=no
  1389. ;;
  1390. esac
  1391. fi
  1392. echo "$ac_t$ld_shlibs" 1>&6
  1393. test "$ld_shlibs" = no && can_build_shared=no
  1394. if test -z "$NM"; then
  1395. echo $ac_n "checking for BSD-compatible nm... $ac_c" 1>&6
  1396. case "$NM" in
  1397. [\\/]* | [A-Za-z]:[\\/]*) ;; # Let the user override the test with a path.
  1398. *)
  1399. IFS="${IFS= }"; ac_save_ifs="$IFS"; IFS="${IFS}${PATH_SEPARATOR}"
  1400. for ac_dir in $PATH /usr/ucb /usr/ccs/bin /bin; do
  1401. test -z "$ac_dir" && ac_dir=.
  1402. if test -f $ac_dir/nm || test -f $ac_dir/nm$ac_exeext; then
  1403. # Check to see if the nm accepts a BSD-compat flag.
  1404. # Adding the `sed 1q' prevents false positives on HP-UX, which says:
  1405. # nm: unknown option "B" ignored
  1406. if ($ac_dir/nm -B /dev/null 2>&1 | sed '1q'; exit 0) | egrep /dev/null >/dev/null; then
  1407. NM="$ac_dir/nm -B"
  1408. break
  1409. elif ($ac_dir/nm -p /dev/null 2>&1 | sed '1q'; exit 0) | egrep /dev/null >/dev/null; then
  1410. NM="$ac_dir/nm -p"
  1411. break
  1412. else
  1413. NM=${NM="$ac_dir/nm"} # keep the first match, but
  1414. continue # so that we can try to find one that supports BSD flags
  1415. fi
  1416. fi
  1417. done
  1418. IFS="$ac_save_ifs"
  1419. test -z "$NM" && NM=nm
  1420. ;;
  1421. esac
  1422. echo "$ac_t$NM" 1>&6
  1423. fi
  1424. # Check for command to grab the raw symbol name followed by C symbol from nm.
  1425. echo $ac_n "checking command to parse $NM output... $ac_c" 1>&6
  1426. # These are sane defaults that work on at least a few old systems.
  1427. # [They come from Ultrix. What could be older than Ultrix?!! ;)]
  1428. # Character class describing NM global symbol codes.
  1429. symcode='[BCDEGRST]'
  1430. # Regexp to match symbols that can be accessed directly from C.
  1431. sympat='\([_A-Za-z][_A-Za-z0-9]*\)'
  1432. # Transform the above into a raw symbol and a C symbol.
  1433. symxfrm='\1 \2\3 \3'
  1434. # Transform an extracted symbol line into a proper C declaration
  1435. global_symbol_to_cdecl="sed -n -e 's/^. .* \(.*\)$/extern char \1;/p'"
  1436. # Define system-specific variables.
  1437. case "$host_os" in
  1438. aix*)
  1439. symcode='[BCDT]'
  1440. ;;
  1441. cygwin* | mingw*)
  1442. symcode='[ABCDGISTW]'
  1443. ;;
  1444. hpux*) # Its linker distinguishes data from code symbols
  1445. global_symbol_to_cdecl="sed -n -e 's/^T .* \(.*\)$/extern char \1();/p' -e 's/^. .* \(.*\)$/extern char \1;/p'"
  1446. ;;
  1447. irix*)
  1448. symcode='[BCDEGRST]'
  1449. ;;
  1450. solaris*)
  1451. symcode='[BDT]'
  1452. ;;
  1453. sysv4)
  1454. symcode='[DFNSTU]'
  1455. ;;
  1456. esac
  1457. # If we're using GNU nm, then use its standard symbol codes.
  1458. if $NM -V 2>&1 | egrep '(GNU|with BFD)' > /dev/null; then
  1459. symcode='[ABCDGISTW]'
  1460. fi
  1461. # Try without a prefix undercore, then with it.
  1462. for ac_symprfx in "" "_"; do
  1463. # Write the raw and C identifiers.
  1464. global_symbol_pipe="sed -n -e 's/^.*[ ]\($symcode\)[ ][ ]*\($ac_symprfx\)$sympat$/$symxfrm/p'"
  1465. # Check to see that the pipe works correctly.
  1466. pipe_works=no
  1467. $rm conftest*
  1468. cat > conftest.c <<EOF
  1469. #ifdef __cplusplus
  1470. extern "C" {
  1471. #endif
  1472. char nm_test_var;
  1473. void nm_test_func(){}
  1474. #ifdef __cplusplus
  1475. }
  1476. #endif
  1477. main(){nm_test_var='a';nm_test_func();return(0);}
  1478. EOF
  1479. echo "$progname:1653: checking if global_symbol_pipe works" >&5
  1480. if { (eval echo $progname:1654: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; } && test -s conftest.$objext; then
  1481. # Now try to grab the symbols.
  1482. nlist=conftest.nm
  1483. if { echo "$progname:1657: eval \"$NM conftest.$objext | $global_symbol_pipe > $nlist\"" >&5; eval "$NM conftest.$objext | $global_symbol_pipe > $nlist 2>&5"; } && test -s "$nlist"; then
  1484. # Try sorting and uniquifying the output.
  1485. if sort "$nlist" | uniq > "$nlist"T; then
  1486. mv -f "$nlist"T "$nlist"
  1487. else
  1488. rm -f "$nlist"T
  1489. fi
  1490. # Make sure that we snagged all the symbols we need.
  1491. if egrep ' nm_test_var$' "$nlist" >/dev/null; then
  1492. if egrep ' nm_test_func$' "$nlist" >/dev/null; then
  1493. cat <<EOF > conftest.c
  1494. #ifdef __cplusplus
  1495. extern "C" {
  1496. #endif
  1497. EOF
  1498. # Now generate the symbol file.
  1499. eval "$global_symbol_to_cdecl"' < "$nlist" >> conftest.c'
  1500. cat <<EOF >> conftest.c
  1501. #if defined (__STDC__) && __STDC__
  1502. # define lt_ptr_t void *
  1503. #else
  1504. # define lt_ptr_t char *
  1505. # define const
  1506. #endif
  1507. /* The mapping between symbol names and symbols. */
  1508. const struct {
  1509. const char *name;
  1510. lt_ptr_t address;
  1511. }
  1512. lt_preloaded_symbols[] =
  1513. {
  1514. EOF
  1515. sed 's/^. \(.*\) \(.*\)$/ {"\2", (lt_ptr_t) \&\2},/' < "$nlist" >> conftest.c
  1516. cat <<\EOF >> conftest.c
  1517. {0, (lt_ptr_t) 0}
  1518. };
  1519. #ifdef __cplusplus
  1520. }
  1521. #endif
  1522. EOF
  1523. # Now try linking the two files.
  1524. mv conftest.$objext conftstm.$objext
  1525. save_LIBS="$LIBS"
  1526. save_CFLAGS="$CFLAGS"
  1527. LIBS="conftstm.$objext"
  1528. CFLAGS="$CFLAGS$no_builtin_flag"
  1529. if { (eval echo $progname:1709: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest; then
  1530. pipe_works=yes
  1531. else
  1532. echo "$progname: failed program was:" >&5
  1533. cat conftest.c >&5
  1534. fi
  1535. LIBS="$save_LIBS"
  1536. else
  1537. echo "cannot find nm_test_func in $nlist" >&5
  1538. fi
  1539. else
  1540. echo "cannot find nm_test_var in $nlist" >&5
  1541. fi
  1542. else
  1543. echo "cannot run $global_symbol_pipe" >&5
  1544. fi
  1545. else
  1546. echo "$progname: failed program was:" >&5
  1547. cat conftest.c >&5
  1548. fi
  1549. $rm conftest* conftst*
  1550. # Do not use the global_symbol_pipe unless it works.
  1551. if test "$pipe_works" = yes; then
  1552. break
  1553. else
  1554. global_symbol_pipe=
  1555. fi
  1556. done
  1557. if test "$pipe_works" = yes; then
  1558. echo "${ac_t}ok" 1>&6
  1559. else
  1560. echo "${ac_t}failed" 1>&6
  1561. fi
  1562. if test -z "$global_symbol_pipe"; then
  1563. global_symbol_to_cdecl=
  1564. fi
  1565. # Check hardcoding attributes.
  1566. echo $ac_n "checking how to hardcode library paths into programs... $ac_c" 1>&6
  1567. hardcode_action=
  1568. if test -n "$hardcode_libdir_flag_spec" || \
  1569. test -n "$runpath_var"; then
  1570. # We can hardcode non-existant directories.
  1571. if test "$hardcode_direct" != no &&
  1572. # If the only mechanism to avoid hardcoding is shlibpath_var, we
  1573. # have to relink, otherwise we might link with an installed library
  1574. # when we should be linking with a yet-to-be-installed one
  1575. ## test "$hardcode_shlibpath_var" != no &&
  1576. test "$hardcode_minus_L" != no; then
  1577. # Linking always hardcodes the temporary library directory.
  1578. hardcode_action=relink
  1579. else
  1580. # We can link without hardcoding, and we can hardcode nonexisting dirs.
  1581. hardcode_action=immediate
  1582. fi
  1583. else
  1584. # We cannot hardcode anything, or else we can only hardcode existing
  1585. # directories.
  1586. hardcode_action=unsupported
  1587. fi
  1588. echo "$ac_t$hardcode_action" 1>&6
  1589. reload_flag=
  1590. reload_cmds='$LD$reload_flag -o $output$reload_objs'
  1591. echo $ac_n "checking for $LD option to reload object files... $ac_c" 1>&6
  1592. # PORTME Some linkers may need a different reload flag.
  1593. reload_flag='-r'
  1594. echo "$ac_t$reload_flag" 1>&6
  1595. test -n "$reload_flag" && reload_flag=" $reload_flag"
  1596. # PORTME Fill in your ld.so characteristics
  1597. library_names_spec=
  1598. libname_spec='lib$name'
  1599. soname_spec=
  1600. postinstall_cmds=
  1601. postuninstall_cmds=
  1602. finish_cmds=
  1603. finish_eval=
  1604. shlibpath_var=
  1605. shlibpath_overrides_runpath=unknown
  1606. version_type=none
  1607. dynamic_linker="$host_os ld.so"
  1608. sys_lib_dlsearch_path_spec="/lib /usr/lib"
  1609. sys_lib_search_path_spec="/lib /usr/lib /usr/local/lib"
  1610. file_magic_cmd=
  1611. file_magic_test_file=
  1612. deplibs_check_method='unknown'
  1613. # Need to set the preceding variable on all platforms that support
  1614. # interlibrary dependencies.
  1615. # 'none' -- dependencies not supported.
  1616. # `unknown' -- same as none, but documents that we really don't know.
  1617. # 'pass_all' -- all dependencies passed with no checks.
  1618. # 'test_compile' -- check by making test program.
  1619. # 'file_magic [regex]' -- check by looking for files in library path
  1620. # which responds to the $file_magic_cmd with a given egrep regex.
  1621. # If you have `file' or equivalent on your system and you're not sure
  1622. # whether `pass_all' will *always* work, you probably want this one.
  1623. echo $ac_n "checking dynamic linker characteristics... $ac_c" 1>&6
  1624. case "$host_os" in
  1625. aix3*)
  1626. version_type=linux
  1627. library_names_spec='${libname}${release}.so$versuffix $libname.a'
  1628. shlibpath_var=LIBPATH
  1629. # AIX has no versioning support, so we append a major version to the name.
  1630. soname_spec='${libname}${release}.so$major'
  1631. ;;
  1632. aix4*)
  1633. version_type=linux
  1634. # AIX has no versioning support, so currently we can not hardcode correct
  1635. # soname into executable. Probably we can add versioning support to
  1636. # collect2, so additional links can be useful in future.
  1637. # We preserve .a as extension for shared libraries though AIX4.2
  1638. # and later linker supports .so
  1639. library_names_spec='${libname}${release}.so$versuffix ${libname}${release}.so$major $libname.a'
  1640. shlibpath_var=LIBPATH
  1641. deplibs_check_method=pass_all
  1642. ;;
  1643. amigaos*)
  1644. library_names_spec='$libname.ixlibrary $libname.a'
  1645. # Create ${libname}_ixlibrary.a entries in /sys/libs.
  1646. finish_eval='for lib in `ls $libdir/*.ixlibrary 2>/dev/null`; do libname=`$echo "X$lib" | $Xsed -e '\''s%^.*/\([^/]*\)\.ixlibrary$%\1%'\''`; test $rm /sys/libs/${libname}_ixlibrary.a; $show "(cd /sys/libs && $LN_S $lib ${libname}_ixlibrary.a)"; (cd /sys/libs && $LN_S $lib ${libname}_ixlibrary.a) || exit 1; done'
  1647. ;;
  1648. beos*)
  1649. library_names_spec='${libname}.so'
  1650. dynamic_linker="$host_os ld.so"
  1651. shlibpath_var=LIBRARY_PATH
  1652. deplibs_check_method=pass_all
  1653. lt_cv_dlopen="load_add_on"
  1654. lt_cv_dlopen_libs=
  1655. lt_cv_dlopen_self=yes
  1656. ;;
  1657. bsdi4*)
  1658. version_type=linux
  1659. need_version=no
  1660. library_names_spec='${libname}${release}.so$versuffix ${libname}${release}.so$major $libname.so'
  1661. soname_spec='${libname}${release}.so$major'
  1662. finish_cmds='PATH="\$PATH:/sbin" ldconfig $libdir'
  1663. shlibpath_var=LD_LIBRARY_PATH
  1664. deplibs_check_method='file_magic ELF [0-9][0-9]*-bit [ML]SB (shared object|dynamic lib)'
  1665. file_magic_cmd=/usr/bin/file
  1666. file_magic_test_file=/shlib/libc.so
  1667. sys_lib_search_path_spec="/shlib /usr/lib /usr/X11/lib /usr/contrib/lib /lib /usr/local/lib"
  1668. sys_lib_dlsearch_path_spec="/shlib /usr/lib /usr/local/lib"
  1669. export_dynamic_flag_spec=-rdynamic
  1670. # the default ld.so.conf also contains /usr/contrib/lib and
  1671. # /usr/X11R6/lib (/usr/X11 is a link to /usr/X11R6), but let us allow
  1672. # libtool to hard-code these into programs
  1673. ;;
  1674. cygwin* | mingw*)
  1675. version_type=windows
  1676. need_version=no
  1677. need_lib_prefix=no
  1678. if test "$with_gcc" = yes; then
  1679. library_names_spec='${libname}`echo ${release} | sed -e 's/[.]/-/g'`${versuffix}.dll $libname.a'
  1680. else
  1681. library_names_spec='${libname}`echo ${release} | sed -e 's/[.]/-/g'`${versuffix}.dll $libname.lib'
  1682. fi
  1683. dynamic_linker='Win32 ld.exe'
  1684. deplibs_check_method='file_magic file format pei*-i386(.*architecture: i386)?'
  1685. file_magic_cmd='${OBJDUMP} -f'
  1686. # FIXME: first we should search . and the directory the executable is in
  1687. shlibpath_var=PATH
  1688. lt_cv_dlopen="LoadLibrary"
  1689. lt_cv_dlopen_libs=
  1690. ;;
  1691. freebsd1*)
  1692. dynamic_linker=no
  1693. ;;
  1694. freebsd*)
  1695. objformat=`test -x /usr/bin/objformat && /usr/bin/objformat || echo aout`
  1696. version_type=freebsd-$objformat
  1697. case "$version_type" in
  1698. freebsd-elf*)
  1699. deplibs_check_method='file_magic ELF [0-9][0-9]*-bit [LM]SB shared object'
  1700. file_magic_cmd=/usr/bin/file
  1701. file_magic_test_file=`echo /usr/lib/libc.so*`
  1702. library_names_spec='${libname}${release}.so$versuffix ${libname}${release}.so $libname.so'
  1703. need_version=no
  1704. need_lib_prefix=no
  1705. ;;
  1706. freebsd-*)
  1707. deplibs_check_method=unknown
  1708. library_names_spec='${libname}${release}.so$versuffix $libname.so$versuffix'
  1709. need_version=yes
  1710. ;;
  1711. esac
  1712. shlibpath_var=LD_LIBRARY_PATH
  1713. case "$host_os" in
  1714. freebsd2* | freebsd3.[01]* | freebsdelf3.[01]*)
  1715. shlibpath_overrides_runpath=yes
  1716. ;;
  1717. *) # from 3.2 on
  1718. shlibpath_overrides_runpath=no
  1719. ;;
  1720. esac
  1721. ;;
  1722. gnu*)
  1723. version_type=linux
  1724. need_lib_prefix=no
  1725. need_version=no
  1726. library_names_spec='${libname}${release}.so$versuffix ${libname}${release}.so${major} ${libname}.so'
  1727. soname_spec='${libname}${release}.so$major'
  1728. shlibpath_var=LD_LIBRARY_PATH
  1729. deplibs_check_method=pass_all
  1730. ;;
  1731. hpux9* | hpux10* | hpux11*)
  1732. # Give a soname corresponding to the major version so that dld.sl refuses to
  1733. # link against other versions.
  1734. dynamic_linker="$host_os dld.sl"
  1735. version_type=sunos
  1736. need_lib_prefix=no
  1737. need_version=no
  1738. shlibpath_var=SHLIB_PATH
  1739. shlibpath_overrides_runpath=no # +s is required to enable SHLIB_PATH
  1740. library_names_spec='${libname}${release}.sl$versuffix ${libname}${release}.sl$major $libname.sl'
  1741. soname_spec='${libname}${release}.sl$major'
  1742. # HP-UX runs *really* slowly unless shared libraries are mode 555.
  1743. postinstall_cmds='chmod 555 $lib'
  1744. case "$host_os" in
  1745. hpux10.20*)
  1746. # TODO: Does this work for hpux-11 too?
  1747. deplibs_check_method='file_magic (s[0-9][0-9][0-9]|PA-RISC[0-9].[0-9]) shared library'
  1748. file_magic_cmd=/usr/bin/file
  1749. file_magic_test_file=/usr/lib/libc.sl
  1750. ;;
  1751. esac
  1752. ;;
  1753. irix5* | irix6*)
  1754. version_type=irix
  1755. need_lib_prefix=no
  1756. need_version=no
  1757. soname_spec='${libname}${release}.so.$major'
  1758. library_names_spec='${libname}${release}.so.$versuffix ${libname}${release}.so.$major ${libname}${release}.so $libname.so'
  1759. case "$host_os" in
  1760. irix5*)
  1761. libsuff= shlibsuff=
  1762. # this will be overridden with pass_all, but let us keep it just in case
  1763. deplibs_check_method="file_magic ELF 32-bit MSB dynamic lib MIPS - version 1"
  1764. ;;
  1765. *)
  1766. case "$LD" in # libtool.m4 will add one of these switches to LD
  1767. *-32|*"-32 ") libsuff= shlibsuff= libmagic=32-bit;;
  1768. *-n32|*"-n32 ") libsuff=32 shlibsuff=N32 libmagic=N32;;
  1769. *-64|*"-64 ") libsuff=64 shlibsuff=64 libmagic=64-bit;;
  1770. *) libsuff= shlibsuff= libmagic=never-match;;
  1771. esac
  1772. ;;
  1773. esac
  1774. shlibpath_var=LD_LIBRARY${shlibsuff}_PATH
  1775. shlibpath_overrides_runpath=no
  1776. sys_lib_search_path_spec="/usr/lib${libsuff} /lib${libsuff} /usr/local/lib${libsuff}"
  1777. sys_lib_dlsearch_path_spec="/usr/lib${libsuff} /lib${libsuff}"
  1778. file_magic_cmd=/usr/bin/file
  1779. file_magic_test_file=`echo /lib${libsuff}/libc.so*`
  1780. deplibs_check_method='pass_all'
  1781. ;;
  1782. # No shared lib support for Linux oldld, aout, or coff.
  1783. linux-gnuoldld* | linux-gnuaout* | linux-gnucoff*)
  1784. dynamic_linker=no
  1785. ;;
  1786. # This must be Linux ELF.
  1787. linux-gnu*)
  1788. version_type=linux
  1789. need_lib_prefix=no
  1790. need_version=no
  1791. library_names_spec='${libname}${release}.so$versuffix ${libname}${release}.so$major $libname.so'
  1792. soname_spec='${libname}${release}.so$major'
  1793. finish_cmds='PATH="\$PATH:/sbin" ldconfig -n $libdir'
  1794. shlibpath_var=LD_LIBRARY_PATH
  1795. shlibpath_overrides_runpath=no
  1796. deplibs_check_method=pass_all
  1797. if test -f /lib/ld.so.1; then
  1798. dynamic_linker='GNU ld.so'
  1799. else
  1800. # Only the GNU ld.so supports shared libraries on MkLinux.
  1801. case "$host_cpu" in
  1802. powerpc*) dynamic_linker=no ;;
  1803. *) dynamic_linker='Linux ld.so' ;;
  1804. esac
  1805. fi
  1806. ;;
  1807. netbsd*)
  1808. version_type=sunos
  1809. if echo __ELF__ | $CC -E - | grep __ELF__ >/dev/null; then
  1810. library_names_spec='${libname}${release}.so$versuffix ${libname}.so$versuffix'
  1811. finish_cmds='PATH="\$PATH:/sbin" ldconfig -m $libdir'
  1812. dynamic_linker='NetBSD (a.out) ld.so'
  1813. else
  1814. library_names_spec='${libname}${release}.so$versuffix ${libname}${release}.so$major ${libname}${release}.so ${libname}.so'
  1815. soname_spec='${libname}${release}.so$major'
  1816. dynamic_linker='NetBSD ld.elf_so'
  1817. fi
  1818. shlibpath_var=LD_LIBRARY_PATH
  1819. ;;
  1820. openbsd*)
  1821. version_type=sunos
  1822. if test "$with_gnu_ld" = yes; then
  1823. need_lib_prefix=no
  1824. need_version=no
  1825. fi
  1826. library_names_spec='${libname}${release}.so$versuffix ${libname}.so$versuffix'
  1827. finish_cmds='PATH="\$PATH:/sbin" ldconfig -m $libdir'
  1828. shlibpath_var=LD_LIBRARY_PATH
  1829. ;;
  1830. os2*)
  1831. libname_spec='$name'
  1832. need_lib_prefix=no
  1833. library_names_spec='$libname.dll $libname.a'
  1834. dynamic_linker='OS/2 ld.exe'
  1835. shlibpath_var=LIBPATH
  1836. ;;
  1837. osf3* | osf4* | osf5*)
  1838. version_type=osf
  1839. need_version=no
  1840. soname_spec='${libname}${release}.so'
  1841. library_names_spec='${libname}${release}.so$versuffix ${libname}${release}.so $libname.so'
  1842. shlibpath_var=LD_LIBRARY_PATH
  1843. # this will be overridden with pass_all, but let us keep it just in case
  1844. deplibs_check_method='file_magic COFF format alpha shared library'
  1845. file_magic_cmd=/usr/bin/file
  1846. file_magic_test_file=/shlib/libc.so
  1847. deplibs_check_method='pass_all'
  1848. sys_lib_search_path_spec="/usr/shlib /usr/ccs/lib /usr/lib/cmplrs/cc /usr/lib /usr/local/lib /var/shlib"
  1849. sys_lib_dlsearch_path_spec="$sys_lib_search_path_spec"
  1850. ;;
  1851. rhapsody*)
  1852. version_type=sunos
  1853. library_names_spec='${libname}.so'
  1854. soname_spec='${libname}.so'
  1855. shlibpath_var=DYLD_LIBRARY_PATH
  1856. deplibs_check_method=pass_all
  1857. ;;
  1858. sco3.2v5*)
  1859. version_type=osf
  1860. soname_spec='${libname}${release}.so$major'
  1861. library_names_spec='${libname}${release}.so$versuffix ${libname}${release}.so$major $libname.so'
  1862. shlibpath_var=LD_LIBRARY_PATH
  1863. ;;
  1864. solaris*)
  1865. version_type=linux
  1866. need_lib_prefix=no
  1867. need_version=no
  1868. library_names_spec='${libname}${release}.so$versuffix ${libname}${release}.so$major $libname.so'
  1869. soname_spec='${libname}${release}.so$major'
  1870. shlibpath_var=LD_LIBRARY_PATH
  1871. shlibpath_overrides_runpath=yes
  1872. # ldd complains unless libraries are executable
  1873. postinstall_cmds='chmod +x $lib'
  1874. deplibs_check_method="file_magic ELF [0-9][0-9]-bit [LM]SB dynamic lib"
  1875. file_magic_cmd=/usr/bin/file
  1876. file_magic_test_file=/lib/libc.so
  1877. ;;
  1878. sunos4*)
  1879. version_type=sunos
  1880. library_names_spec='${libname}${release}.so$versuffix ${libname}.so$versuffix'
  1881. finish_cmds='PATH="\$PATH:/usr/etc" ldconfig $libdir'
  1882. shlibpath_var=LD_LIBRARY_PATH
  1883. shlibpath_overrides_runpath=yes
  1884. if test "$with_gnu_ld" = yes; then
  1885. need_lib_prefix=no
  1886. fi
  1887. need_version=yes
  1888. ;;
  1889. sysv4 | sysv4.2uw2* | sysv4.3* | sysv5*)
  1890. version_type=linux
  1891. library_names_spec='${libname}${release}.so$versuffix ${libname}${release}.so$major $libname.so'
  1892. soname_spec='${libname}${release}.so$major'
  1893. shlibpath_var=LD_LIBRARY_PATH
  1894. case "$host_vendor" in
  1895. sequent)
  1896. file_magic_cmd='/bin/file'
  1897. deplibs_check_method='file_magic ELF [0-9][0-9]*-bit [LM]SB (shared object|dynamic lib )'
  1898. ;;
  1899. ncr)
  1900. deplibs_check_method='pass_all'
  1901. ;;
  1902. motorola)
  1903. need_lib_prefix=no
  1904. need_version=no
  1905. shlibpath_overrides_runpath=no
  1906. sys_lib_search_path_spec='/lib /usr/lib /usr/ccs/lib'
  1907. deplibs_check_method='file_magic ELF [0-9][0-9]*-bit [ML]SB (shared object|dynamic lib) M[0-9][0-9]* Version [0-9]'
  1908. file_magic_cmd=/usr/bin/file
  1909. file_magic_test_file=`echo /usr/lib/libc.so*`
  1910. ;;
  1911. esac
  1912. ;;
  1913. uts4*)
  1914. version_type=linux
  1915. library_names_spec='${libname}${release}.so$versuffix ${libname}${release}.so$major $libname.so'
  1916. soname_spec='${libname}${release}.so$major'
  1917. shlibpath_var=LD_LIBRARY_PATH
  1918. ;;
  1919. dgux*)
  1920. version_type=linux
  1921. need_lib_prefix=no
  1922. need_version=no
  1923. library_names_spec='${libname}${release}.so$versuffix ${libname}${release}.so$major $libname.so'
  1924. soname_spec='${libname}${release}.so$major'
  1925. shlibpath_var=LD_LIBRARY_PATH
  1926. ;;
  1927. sysv4*MP*)
  1928. if test -d /usr/nec ;then
  1929. version_type=linux
  1930. library_names_spec='$libname.so.$versuffix $libname.so.$major $libname.so'
  1931. soname_spec='$libname.so.$major'
  1932. shlibpath_var=LD_LIBRARY_PATH
  1933. fi
  1934. ;;
  1935. *)
  1936. dynamic_linker=no
  1937. ;;
  1938. esac
  1939. echo "$ac_t$dynamic_linker" 1>&6
  1940. test "$dynamic_linker" = no && can_build_shared=no
  1941. # Report the final consequences.
  1942. echo "checking if libtool supports shared libraries... $can_build_shared" 1>&6
  1943. # Only try to build win32 dlls if AC_LIBTOOL_WIN32_DLL was used in
  1944. # configure.in, otherwise build static only libraries.
  1945. case "$host_os" in
  1946. cygwin* | mingw* | os2*)
  1947. if test x$can_build_shared = xyes; then
  1948. test x$enable_win32_dll = xno && can_build_shared=no
  1949. echo "checking if package supports dlls... $can_build_shared" 1>&6
  1950. fi
  1951. ;;
  1952. esac
  1953. if test -n "$file_magic_test_file" && test -n "$file_magic_cmd"; then
  1954. case "$deplibs_check_method" in
  1955. "file_magic "*)
  1956. file_magic_regex="`expr \"$deplibs_check_method\" : \"file_magic \(.*\)\"`"
  1957. if eval $file_magic_cmd \$file_magic_test_file 2> /dev/null |
  1958. egrep "$file_magic_regex" > /dev/null; then
  1959. :
  1960. else
  1961. cat <<EOF 1>&2
  1962. *** Warning: the command libtool uses to detect shared libraries,
  1963. *** $file_magic_cmd, produces output that libtool cannot recognize.
  1964. *** The result is that libtool may fail to recognize shared libraries
  1965. *** as such. This will affect the creation of libtool libraries that
  1966. *** depend on shared libraries, but programs linked with such libtool
  1967. *** libraries will work regardless of this problem. Nevertheless, you
  1968. *** may want to report the problem to your system manager and/or to
  1969. *** bug-libtool@gnu.org
  1970. EOF
  1971. fi ;;
  1972. esac
  1973. fi
  1974. echo $ac_n "checking whether to build shared libraries... $ac_c" 1>&6
  1975. test "$can_build_shared" = "no" && enable_shared=no
  1976. # On AIX, shared libraries and static libraries use the same namespace, and
  1977. # are all built from PIC.
  1978. case "$host_os" in
  1979. aix3*)
  1980. test "$enable_shared" = yes && enable_static=no
  1981. if test -n "$RANLIB"; then
  1982. archive_cmds="$archive_cmds~\$RANLIB \$lib"
  1983. postinstall_cmds='$RANLIB $lib'
  1984. fi
  1985. ;;
  1986. aix4*)
  1987. test "$enable_shared" = yes && enable_static=no
  1988. ;;
  1989. esac
  1990. echo "$ac_t$enable_shared" 1>&6
  1991. # Make sure either enable_shared or enable_static is yes.
  1992. test "$enable_shared" = yes || enable_static=yes
  1993. echo "checking whether to build static libraries... $enable_static" 1>&6
  1994. if test "$hardcode_action" = relink; then
  1995. # Fast installation is not supported
  1996. enable_fast_install=no
  1997. elif test "$shlibpath_overrides_runpath" = yes ||
  1998. test "$enable_shared" = no; then
  1999. # Fast installation is not necessary
  2000. enable_fast_install=needless
  2001. fi
  2002. echo $ac_n "checking for objdir... $ac_c" 1>&6
  2003. rm -f .libs 2>/dev/null
  2004. mkdir .libs 2>/dev/null
  2005. if test -d .libs; then
  2006. objdir=.libs
  2007. else
  2008. # MS-DOS does not allow filenames that begin with a dot.
  2009. objdir=_libs
  2010. fi
  2011. rmdir .libs 2>/dev/null
  2012. echo "$ac_t$objdir" 1>&6
  2013. if test "x$enable_dlopen" != xyes; then
  2014. enable_dlopen=unknown
  2015. enable_dlopen_self=unknown
  2016. enable_dlopen_self_static=unknown
  2017. else
  2018. if eval "test \"`echo '$''{'lt_cv_dlopen'+set}'`\" != set"; then
  2019. lt_cv_dlopen=no lt_cv_dlopen_libs=
  2020. echo $ac_n "checking for dlopen in -ldl""... $ac_c" 1>&6
  2021. echo "$progname:2248: checking for dlopen in -ldl" >&5
  2022. ac_lib_var=`echo dl'_'dlopen | sed 'y%./+-%__p_%'`
  2023. if eval "test \"`echo '$''{'ac_cv_lib_$ac_lib_var'+set}'`\" = set"; then
  2024. echo $ac_n "(cached) $ac_c" 1>&6
  2025. else
  2026. ac_save_LIBS="$LIBS"
  2027. LIBS="-ldl $LIBS"
  2028. cat > conftest.$ac_ext <<EOF
  2029. #line 2256 "ltconfig"
  2030. /* Override any gcc2 internal prototype to avoid an error. */
  2031. /* We use char because int might match the return type of a gcc2
  2032. builtin and then its argument prototype would still apply. */
  2033. #ifdef __cplusplus
  2034. extern "C"
  2035. #endif
  2036. char dlopen();
  2037. int main() {
  2038. dlopen()
  2039. ; return 0; }
  2040. EOF
  2041. if { (eval echo $progname:2269: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
  2042. rm -rf conftest*
  2043. eval "ac_cv_lib_$ac_lib_var=yes"
  2044. else
  2045. echo "$progname: failed program was:" >&5
  2046. cat conftest.$ac_ext >&5
  2047. rm -rf conftest*
  2048. eval "ac_cv_lib_$ac_lib_var=no"
  2049. fi
  2050. rm -f conftest*
  2051. LIBS="$ac_save_LIBS"
  2052. fi
  2053. if eval "test \"`echo '$ac_cv_lib_'$ac_lib_var`\" = yes"; then
  2054. echo "$ac_t""yes" 1>&6
  2055. lt_cv_dlopen="dlopen" lt_cv_dlopen_libs="-ldl"
  2056. else
  2057. echo "$ac_t""no" 1>&6
  2058. echo $ac_n "checking for dlopen""... $ac_c" 1>&6
  2059. echo "$progname:2288: checking for dlopen" >&5
  2060. if eval "test \"`echo '$''{'ac_cv_func_dlopen'+set}'`\" = set"; then
  2061. echo $ac_n "(cached) $ac_c" 1>&6
  2062. else
  2063. cat > conftest.$ac_ext <<EOF
  2064. #line 2293 "ltconfig"
  2065. /* System header to define __stub macros and hopefully few prototypes,
  2066. which can conflict with char dlopen(); below. */
  2067. #include <assert.h>
  2068. /* Override any gcc2 internal prototype to avoid an error. */
  2069. /* We use char because int might match the return type of a gcc2
  2070. builtin and then its argument prototype would still apply. */
  2071. #ifdef __cplusplus
  2072. extern "C"
  2073. #endif
  2074. char dlopen();
  2075. int main() {
  2076. /* The GNU C library defines this for functions which it implements
  2077. to always fail with ENOSYS. Some functions are actually named
  2078. something starting with __ and the normal name is an alias. */
  2079. #if defined (__stub_dlopen) || defined (__stub___dlopen)
  2080. choke me
  2081. #else
  2082. dlopen();
  2083. #endif
  2084. ; return 0; }
  2085. EOF
  2086. if { (eval echo $progname:2318: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
  2087. rm -rf conftest*
  2088. eval "ac_cv_func_dlopen=yes"
  2089. else
  2090. echo "$progname: failed program was:" >&5
  2091. cat conftest.$ac_ext >&5
  2092. rm -rf conftest*
  2093. eval "ac_cv_func_dlopen=no"
  2094. fi
  2095. rm -f conftest*
  2096. fi
  2097. if eval "test \"`echo '$ac_cv_func_'dlopen`\" = yes"; then
  2098. echo "$ac_t""yes" 1>&6
  2099. lt_cv_dlopen="dlopen"
  2100. else
  2101. echo "$ac_t""no" 1>&6
  2102. echo $ac_n "checking for dld_link in -ldld""... $ac_c" 1>&6
  2103. echo "$progname:2335: checking for dld_link in -ldld" >&5
  2104. ac_lib_var=`echo dld'_'dld_link | sed 'y%./+-%__p_%'`
  2105. if eval "test \"`echo '$''{'ac_cv_lib_$ac_lib_var'+set}'`\" = set"; then
  2106. echo $ac_n "(cached) $ac_c" 1>&6
  2107. else
  2108. ac_save_LIBS="$LIBS"
  2109. LIBS="-ldld $LIBS"
  2110. cat > conftest.$ac_ext <<EOF
  2111. #line 2343 "ltconfig"
  2112. /* Override any gcc2 internal prototype to avoid an error. */
  2113. /* We use char because int might match the return type of a gcc2
  2114. builtin and then its argument prototype would still apply. */
  2115. #ifdef __cplusplus
  2116. extern "C"
  2117. #endif
  2118. char dld_link();
  2119. int main() {
  2120. dld_link()
  2121. ; return 0; }
  2122. EOF
  2123. if { (eval echo $progname:2356: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
  2124. rm -rf conftest*
  2125. eval "ac_cv_lib_$ac_lib_var=yes"
  2126. else
  2127. echo "$progname: failed program was:" >&5
  2128. cat conftest.$ac_ext >&5
  2129. rm -rf conftest*
  2130. eval "ac_cv_lib_$ac_lib_var=no"
  2131. fi
  2132. rm -f conftest*
  2133. LIBS="$ac_save_LIBS"
  2134. fi
  2135. if eval "test \"`echo '$ac_cv_lib_'$ac_lib_var`\" = yes"; then
  2136. echo "$ac_t""yes" 1>&6
  2137. lt_cv_dlopen="dld_link" lt_cv_dlopen_libs="-ldld"
  2138. else
  2139. echo "$ac_t""no" 1>&6
  2140. echo $ac_n "checking for shl_load""... $ac_c" 1>&6
  2141. echo "$progname:2375: checking for shl_load" >&5
  2142. if eval "test \"`echo '$''{'ac_cv_func_shl_load'+set}'`\" = set"; then
  2143. echo $ac_n "(cached) $ac_c" 1>&6
  2144. else
  2145. cat > conftest.$ac_ext <<EOF
  2146. #line 2380 "ltconfig"
  2147. /* System header to define __stub macros and hopefully few prototypes,
  2148. which can conflict with char shl_load(); below. */
  2149. #include <assert.h>
  2150. /* Override any gcc2 internal prototype to avoid an error. */
  2151. /* We use char because int might match the return type of a gcc2
  2152. builtin and then its argument prototype would still apply. */
  2153. #ifdef __cplusplus
  2154. extern "C"
  2155. #endif
  2156. char shl_load();
  2157. int main() {
  2158. /* The GNU C library defines this for functions which it implements
  2159. to always fail with ENOSYS. Some functions are actually named
  2160. something starting with __ and the normal name is an alias. */
  2161. #if defined (__stub_shl_load) || defined (__stub___shl_load)
  2162. choke me
  2163. #else
  2164. shl_load();
  2165. #endif
  2166. ; return 0; }
  2167. EOF
  2168. if { (eval echo $progname:2405: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
  2169. rm -rf conftest*
  2170. eval "ac_cv_func_shl_load=yes"
  2171. else
  2172. echo "$progname: failed program was:" >&5
  2173. cat conftest.$ac_ext >&5
  2174. rm -rf conftest*
  2175. eval "ac_cv_func_shl_load=no"
  2176. fi
  2177. rm -f conftest*
  2178. fi
  2179. if eval "test \"`echo '$ac_cv_func_'shl_load`\" = yes"; then
  2180. echo "$ac_t""yes" 1>&6
  2181. lt_cv_dlopen="shl_load"
  2182. else
  2183. echo "$ac_t""no" 1>&6
  2184. echo $ac_n "checking for shl_load in -ldld""... $ac_c" 1>&6
  2185. echo "$progname:2423: checking for shl_load in -ldld" >&5
  2186. ac_lib_var=`echo dld'_'shl_load | sed 'y%./+-%__p_%'`
  2187. if eval "test \"`echo '$''{'ac_cv_lib_$ac_lib_var'+set}'`\" = set"; then
  2188. echo $ac_n "(cached) $ac_c" 1>&6
  2189. else
  2190. ac_save_LIBS="$LIBS"
  2191. LIBS="-ldld $LIBS"
  2192. cat > conftest.$ac_ext <<EOF
  2193. #line 2431 "ltconfig"
  2194. #include "confdefs.h"
  2195. /* Override any gcc2 internal prototype to avoid an error. */
  2196. /* We use char because int might match the return type of a gcc2
  2197. builtin and then its argument prototype would still apply. */
  2198. #ifdef __cplusplus
  2199. extern "C"
  2200. #endif
  2201. char shl_load();
  2202. int main() {
  2203. shl_load()
  2204. ; return 0; }
  2205. EOF
  2206. if { (eval echo $progname:2445: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
  2207. rm -rf conftest*
  2208. eval "ac_cv_lib_$ac_lib_var=yes"
  2209. else
  2210. echo "$progname: failed program was:" >&5
  2211. cat conftest.$ac_ext >&5
  2212. rm -rf conftest*
  2213. eval "ac_cv_lib_$ac_lib_var=no"
  2214. fi
  2215. rm -f conftest*
  2216. LIBS="$ac_save_LIBS"
  2217. fi
  2218. if eval "test \"`echo '$ac_cv_lib_'$ac_lib_var`\" = yes"; then
  2219. echo "$ac_t""yes" 1>&6
  2220. lt_cv_dlopen="shl_load" lt_cv_dlopen_libs="-ldld"
  2221. else
  2222. echo "$ac_t""no" 1>&6
  2223. fi
  2224. fi
  2225. fi
  2226. fi
  2227. fi
  2228. fi
  2229. if test "x$lt_cv_dlopen" != xno; then
  2230. enable_dlopen=yes
  2231. fi
  2232. case "$lt_cv_dlopen" in
  2233. dlopen)
  2234. for ac_hdr in dlfcn.h; do
  2235. ac_safe=`echo "$ac_hdr" | sed 'y%./+-%__p_%'`
  2236. echo $ac_n "checking for $ac_hdr""... $ac_c" 1>&6
  2237. echo "$progname:2488: checking for $ac_hdr" >&5
  2238. if eval "test \"`echo '$''{'ac_cv_header_$ac_safe'+set}'`\" = set"; then
  2239. echo $ac_n "(cached) $ac_c" 1>&6
  2240. else
  2241. cat > conftest.$ac_ext <<EOF
  2242. #line 2493 "ltconfig"
  2243. #include <$ac_hdr>
  2244. int fnord = 0;
  2245. EOF
  2246. ac_try="$ac_compile >/dev/null 2>conftest.out"
  2247. { (eval echo $progname:2498: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }
  2248. ac_err=`grep -v '^ *+' conftest.out | grep -v "^conftest.${ac_ext}\$"`
  2249. if test -z "$ac_err"; then
  2250. rm -rf conftest*
  2251. eval "ac_cv_header_$ac_safe=yes"
  2252. else
  2253. echo "$ac_err" >&5
  2254. echo "$progname: failed program was:" >&5
  2255. cat conftest.$ac_ext >&5
  2256. rm -rf conftest*
  2257. eval "ac_cv_header_$ac_safe=no"
  2258. fi
  2259. rm -f conftest*
  2260. fi
  2261. if eval "test \"`echo '$ac_cv_header_'$ac_safe`\" = yes"; then
  2262. echo "$ac_t""yes" 1>&6
  2263. else
  2264. echo "$ac_t""no" 1>&6
  2265. fi
  2266. done
  2267. if test "x$ac_cv_header_dlfcn_h" = xyes; then
  2268. CPPFLAGS="$CPPFLAGS -DHAVE_DLFCN_H"
  2269. fi
  2270. eval LDFLAGS=\"\$LDFLAGS $export_dynamic_flag_spec\"
  2271. LIBS="$lt_cv_dlopen_libs $LIBS"
  2272. echo $ac_n "checking whether a program can dlopen itself""... $ac_c" 1>&6
  2273. echo "$progname:2526: checking whether a program can dlopen itself" >&5
  2274. if test "${lt_cv_dlopen_self+set}" = set; then
  2275. echo $ac_n "(cached) $ac_c" 1>&6
  2276. else
  2277. if test "$cross_compiling" = yes; then
  2278. lt_cv_dlopen_self=cross
  2279. else
  2280. cat > conftest.c <<EOF
  2281. #line 2534 "ltconfig"
  2282. #if HAVE_DLFCN_H
  2283. #include <dlfcn.h>
  2284. #endif
  2285. #include <stdio.h>
  2286. #ifdef RTLD_GLOBAL
  2287. # define LTDL_GLOBAL RTLD_GLOBAL
  2288. #else
  2289. # ifdef DL_GLOBAL
  2290. # define LTDL_GLOBAL DL_GLOBAL
  2291. # else
  2292. # define LTDL_GLOBAL 0
  2293. # endif
  2294. #endif
  2295. /* We may have to define LTDL_LAZY_OR_NOW in the command line if we
  2296. find out it does not work in some platform. */
  2297. #ifndef LTDL_LAZY_OR_NOW
  2298. # ifdef RTLD_LAZY
  2299. # define LTDL_LAZY_OR_NOW RTLD_LAZY
  2300. # else
  2301. # ifdef DL_LAZY
  2302. # define LTDL_LAZY_OR_NOW DL_LAZY
  2303. # else
  2304. # ifdef RTLD_NOW
  2305. # define LTDL_LAZY_OR_NOW RTLD_NOW
  2306. # else
  2307. # ifdef DL_NOW
  2308. # define LTDL_LAZY_OR_NOW DL_NOW
  2309. # else
  2310. # define LTDL_LAZY_OR_NOW 0
  2311. # endif
  2312. # endif
  2313. # endif
  2314. # endif
  2315. #endif
  2316. fnord() { int i=42;}
  2317. main() { void *self, *ptr1, *ptr2; self=dlopen(0,LTDL_GLOBAL|LTDL_LAZY_OR_NOW);
  2318. if(self) { ptr1=dlsym(self,"fnord"); ptr2=dlsym(self,"_fnord");
  2319. if(ptr1 || ptr2) { dlclose(self); exit(0); } } exit(1); }
  2320. EOF
  2321. if { (eval echo $progname:2580: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest && (./conftest; exit) 2>/dev/null
  2322. then
  2323. lt_cv_dlopen_self=yes
  2324. else
  2325. echo "$progname: failed program was:" >&5
  2326. cat conftest.$ac_ext >&5
  2327. rm -fr conftest*
  2328. lt_cv_dlopen_self=no
  2329. fi
  2330. rm -fr conftest*
  2331. fi
  2332. fi
  2333. echo "$ac_t""$lt_cv_dlopen_self" 1>&6
  2334. if test "$lt_cv_dlopen_self" = yes; then
  2335. LDFLAGS="$LDFLAGS $link_static_flag"
  2336. echo $ac_n "checking whether a statically linked program can dlopen itself""... $ac_c" 1>&6
  2337. echo "$progname:2599: checking whether a statically linked program can dlopen itself" >&5
  2338. if test "${lt_cv_dlopen_self_static+set}" = set; then
  2339. echo $ac_n "(cached) $ac_c" 1>&6
  2340. else
  2341. if test "$cross_compiling" = yes; then
  2342. lt_cv_dlopen_self_static=cross
  2343. else
  2344. cat > conftest.c <<EOF
  2345. #line 2607 "ltconfig"
  2346. #if HAVE_DLFCN_H
  2347. #include <dlfcn.h>
  2348. #endif
  2349. #include <stdio.h>
  2350. #ifdef RTLD_GLOBAL
  2351. # define LTDL_GLOBAL RTLD_GLOBAL
  2352. #else
  2353. # ifdef DL_GLOBAL
  2354. # define LTDL_GLOBAL DL_GLOBAL
  2355. # else
  2356. # define LTDL_GLOBAL 0
  2357. # endif
  2358. #endif
  2359. /* We may have to define LTDL_LAZY_OR_NOW in the command line if we
  2360. find out it does not work in some platform. */
  2361. #ifndef LTDL_LAZY_OR_NOW
  2362. # ifdef RTLD_LAZY
  2363. # define LTDL_LAZY_OR_NOW RTLD_LAZY
  2364. # else
  2365. # ifdef DL_LAZY
  2366. # define LTDL_LAZY_OR_NOW DL_LAZY
  2367. # else
  2368. # ifdef RTLD_NOW
  2369. # define LTDL_LAZY_OR_NOW RTLD_NOW
  2370. # else
  2371. # ifdef DL_NOW
  2372. # define LTDL_LAZY_OR_NOW DL_NOW
  2373. # else
  2374. # define LTDL_LAZY_OR_NOW 0
  2375. # endif
  2376. # endif
  2377. # endif
  2378. # endif
  2379. #endif
  2380. fnord() { int i=42;}
  2381. main() { void *self, *ptr1, *ptr2; self=dlopen(0,LTDL_GLOBAL|LTDL_LAZY_OR_NOW);
  2382. if(self) { ptr1=dlsym(self,"fnord"); ptr2=dlsym(self,"_fnord");
  2383. if(ptr1 || ptr2) { dlclose(self); exit(0); } } exit(1); }
  2384. EOF
  2385. if { (eval echo $progname:2653: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest && (./conftest; exit) 2>/dev/null
  2386. then
  2387. lt_cv_dlopen_self_static=yes
  2388. else
  2389. echo "$progname: failed program was:" >&5
  2390. cat conftest.$ac_ext >&5
  2391. rm -fr conftest*
  2392. lt_cv_dlopen_self_static=no
  2393. fi
  2394. rm -fr conftest*
  2395. fi
  2396. fi
  2397. echo "$ac_t""$lt_cv_dlopen_self_static" 1>&6
  2398. fi
  2399. ;;
  2400. esac
  2401. case "$lt_cv_dlopen_self" in
  2402. yes|no) enable_dlopen_self=$lt_cv_dlopen_self ;;
  2403. *) enable_dlopen_self=unknown ;;
  2404. esac
  2405. case "$lt_cv_dlopen_self_static" in
  2406. yes|no) enable_dlopen_self_static=$lt_cv_dlopen_self_static ;;
  2407. *) enable_dlopen_self_static=unknown ;;
  2408. esac
  2409. fi
  2410. # Copy echo and quote the copy, instead of the original, because it is
  2411. # used later.
  2412. ltecho="$echo"
  2413. if test "X$ltecho" = "X$CONFIG_SHELL $0 --fallback-echo"; then
  2414. ltecho="$CONFIG_SHELL \$0 --fallback-echo"
  2415. fi
  2416. LTSHELL="$SHELL"
  2417. LTCONFIG_VERSION="$VERSION"
  2418. # Only quote variables if we're using ltmain.sh.
  2419. case "$ltmain" in
  2420. *.sh)
  2421. # Now quote all the things that may contain metacharacters.
  2422. for var in ltecho old_CC old_CFLAGS old_CPPFLAGS \
  2423. old_LD old_LDFLAGS old_LIBS \
  2424. old_NM old_RANLIB old_LN_S old_DLLTOOL old_OBJDUMP old_AS \
  2425. AR CC LD LN_S NM LTSHELL LTCONFIG_VERSION \
  2426. reload_flag reload_cmds wl \
  2427. pic_flag link_static_flag no_builtin_flag export_dynamic_flag_spec \
  2428. thread_safe_flag_spec whole_archive_flag_spec libname_spec \
  2429. library_names_spec soname_spec \
  2430. RANLIB old_archive_cmds old_archive_from_new_cmds old_postinstall_cmds \
  2431. old_postuninstall_cmds archive_cmds archive_expsym_cmds postinstall_cmds postuninstall_cmds \
  2432. file_magic_cmd export_symbols_cmds deplibs_check_method allow_undefined_flag no_undefined_flag \
  2433. finish_cmds finish_eval global_symbol_pipe global_symbol_to_cdecl \
  2434. hardcode_libdir_flag_spec hardcode_libdir_separator \
  2435. sys_lib_search_path_spec sys_lib_dlsearch_path_spec \
  2436. compiler_c_o compiler_o_lo need_locks exclude_expsyms include_expsyms; do
  2437. case "$var" in
  2438. reload_cmds | old_archive_cmds | old_archive_from_new_cmds | \
  2439. old_postinstall_cmds | old_postuninstall_cmds | \
  2440. export_symbols_cmds | archive_cmds | archive_expsym_cmds | \
  2441. postinstall_cmds | postuninstall_cmds | \
  2442. finish_cmds | sys_lib_search_path_spec | sys_lib_dlsearch_path_spec)
  2443. # Double-quote double-evaled strings.
  2444. eval "$var=\\\"\`\$echo \"X\$$var\" | \$Xsed -e \"\$double_quote_subst\" -e \"\$sed_quote_subst\" -e \"\$delay_variable_subst\"\`\\\""
  2445. ;;
  2446. *)
  2447. eval "$var=\\\"\`\$echo \"X\$$var\" | \$Xsed -e \"\$sed_quote_subst\"\`\\\""
  2448. ;;
  2449. esac
  2450. done
  2451. case "$ltecho" in
  2452. *'\$0 --fallback-echo"')
  2453. ltecho=`$echo "X$ltecho" | $Xsed -e 's/\\\\\\\$0 --fallback-echo"$/$0 --fallback-echo"/'`
  2454. ;;
  2455. esac
  2456. trap "$rm \"$ofile\"; exit 1" 1 2 15
  2457. echo "creating $ofile"
  2458. $rm "$ofile"
  2459. cat <<EOF > "$ofile"
  2460. #! $SHELL
  2461. # `$echo "$ofile" | sed 's%^.*/%%'` - Provide generalized library-building support services.
  2462. # Generated automatically by $PROGRAM (GNU $PACKAGE $VERSION$TIMESTAMP)
  2463. # NOTE: Changes made to this file will be lost: look at ltconfig or ltmain.sh.
  2464. #
  2465. # Copyright (C) 1996-1999 Free Software Foundation, Inc.
  2466. # Originally by Gordon Matzigkeit <gord@gnu.ai.mit.edu>, 1996
  2467. #
  2468. # This program is free software; you can redistribute it and/or modify
  2469. # it under the terms of the GNU General Public License as published by
  2470. # the Free Software Foundation; either version 2 of the License, or
  2471. # (at your option) any later version.
  2472. #
  2473. # This program is distributed in the hope that it will be useful, but
  2474. # WITHOUT ANY WARRANTY; without even the implied warranty of
  2475. # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
  2476. # General Public License for more details.
  2477. #
  2478. # You should have received a copy of the GNU General Public License
  2479. # along with this program; if not, write to the Free Software
  2480. # Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
  2481. #
  2482. # As a special exception to the GNU General Public License, if you
  2483. # distribute this file as part of a program that contains a
  2484. # configuration script generated by Autoconf, you may include it under
  2485. # the same distribution terms that you use for the rest of that program.
  2486. # Sed that helps us avoid accidentally triggering echo(1) options like -n.
  2487. Xsed="sed -e s/^X//"
  2488. # The HP-UX ksh and POSIX shell print the target directory to stdout
  2489. # if CDPATH is set.
  2490. if test "X\${CDPATH+set}" = Xset; then CDPATH=:; export CDPATH; fi
  2491. ### BEGIN LIBTOOL CONFIG
  2492. EOF
  2493. cfgfile="$ofile"
  2494. ;;
  2495. *)
  2496. # Double-quote the variables that need it (for aesthetics).
  2497. for var in old_CC old_CFLAGS old_CPPFLAGS \
  2498. old_LD old_LDFLAGS old_LIBS \
  2499. old_NM old_RANLIB old_LN_S old_DLLTOOL old_OBJDUMP old_AS; do
  2500. eval "$var=\\\"\$var\\\""
  2501. done
  2502. # Just create a config file.
  2503. cfgfile="$ofile.cfg"
  2504. trap "$rm \"$cfgfile\"; exit 1" 1 2 15
  2505. echo "creating $cfgfile"
  2506. $rm "$cfgfile"
  2507. cat <<EOF > "$cfgfile"
  2508. # `$echo "$cfgfile" | sed 's%^.*/%%'` - Libtool configuration file.
  2509. # Generated automatically by $PROGRAM (GNU $PACKAGE $VERSION$TIMESTAMP)
  2510. EOF
  2511. ;;
  2512. esac
  2513. cat <<EOF >> "$cfgfile"
  2514. # Libtool was configured as follows, on host `(hostname || uname -n) 2>/dev/null | sed 1q`:
  2515. #
  2516. # CC=$old_CC CFLAGS=$old_CFLAGS CPPFLAGS=$old_CPPFLAGS \\
  2517. # LD=$old_LD LDFLAGS=$old_LDFLAGS LIBS=$old_LIBS \\
  2518. # NM=$old_NM RANLIB=$old_RANLIB LN_S=$old_LN_S \\
  2519. # DLLTOOL=$old_DLLTOOL OBJDUMP=$old_OBJDUMP AS=$old_AS \\
  2520. # $0$ltconfig_args
  2521. #
  2522. # Compiler and other test output produced by $progname, useful for
  2523. # debugging $progname, is in ./config.log if it exists.
  2524. # The version of $progname that generated this script.
  2525. LTCONFIG_VERSION=$LTCONFIG_VERSION
  2526. # Shell to use when invoking shell scripts.
  2527. SHELL=$LTSHELL
  2528. # Whether or not to build shared libraries.
  2529. build_libtool_libs=$enable_shared
  2530. # Whether or not to build static libraries.
  2531. build_old_libs=$enable_static
  2532. # Whether or not to optimize for fast installation.
  2533. fast_install=$enable_fast_install
  2534. # The host system.
  2535. host_alias=$host_alias
  2536. host=$host
  2537. # An echo program that does not interpret backslashes.
  2538. echo=$ltecho
  2539. # The archiver.
  2540. AR=$AR
  2541. # The default C compiler.
  2542. CC=$CC
  2543. # The linker used to build libraries.
  2544. LD=$LD
  2545. # Whether we need hard or soft links.
  2546. LN_S=$LN_S
  2547. # A BSD-compatible nm program.
  2548. NM=$NM
  2549. # Used on cygwin: DLL creation program.
  2550. DLLTOOL="$DLLTOOL"
  2551. # Used on cygwin: object dumper.
  2552. OBJDUMP="$OBJDUMP"
  2553. # Used on cygwin: assembler.
  2554. AS="$AS"
  2555. # The name of the directory that contains temporary libtool files.
  2556. objdir=$objdir
  2557. # How to create reloadable object files.
  2558. reload_flag=$reload_flag
  2559. reload_cmds=$reload_cmds
  2560. # How to pass a linker flag through the compiler.
  2561. wl=$wl
  2562. # Object file suffix (normally "o").
  2563. objext="$objext"
  2564. # Old archive suffix (normally "a").
  2565. libext="$libext"
  2566. # Executable file suffix (normally "").
  2567. exeext="$exeext"
  2568. # Additional compiler flags for building library objects.
  2569. pic_flag=$pic_flag
  2570. # Does compiler simultaneously support -c and -o options?
  2571. compiler_c_o=$compiler_c_o
  2572. # Can we write directly to a .lo ?
  2573. compiler_o_lo=$compiler_o_lo
  2574. # Must we lock files when doing compilation ?
  2575. need_locks=$need_locks
  2576. # Do we need the lib prefix for modules?
  2577. need_lib_prefix=$need_lib_prefix
  2578. # Do we need a version for libraries?
  2579. need_version=$need_version
  2580. # Whether dlopen is supported.
  2581. dlopen=$enable_dlopen
  2582. # Whether dlopen of programs is supported.
  2583. dlopen_self=$enable_dlopen_self
  2584. # Whether dlopen of statically linked programs is supported.
  2585. dlopen_self_static=$enable_dlopen_self_static
  2586. # Compiler flag to prevent dynamic linking.
  2587. link_static_flag=$link_static_flag
  2588. # Compiler flag to turn off builtin functions.
  2589. no_builtin_flag=$no_builtin_flag
  2590. # Compiler flag to allow reflexive dlopens.
  2591. export_dynamic_flag_spec=$export_dynamic_flag_spec
  2592. # Compiler flag to generate shared objects directly from archives.
  2593. whole_archive_flag_spec=$whole_archive_flag_spec
  2594. # Compiler flag to generate thread-safe objects.
  2595. thread_safe_flag_spec=$thread_safe_flag_spec
  2596. # Library versioning type.
  2597. version_type=$version_type
  2598. # Format of library name prefix.
  2599. libname_spec=$libname_spec
  2600. # List of archive names. First name is the real one, the rest are links.
  2601. # The last name is the one that the linker finds with -lNAME.
  2602. library_names_spec=$library_names_spec
  2603. # The coded name of the library, if different from the real name.
  2604. soname_spec=$soname_spec
  2605. # Commands used to build and install an old-style archive.
  2606. RANLIB=$RANLIB
  2607. old_archive_cmds=$old_archive_cmds
  2608. old_postinstall_cmds=$old_postinstall_cmds
  2609. old_postuninstall_cmds=$old_postuninstall_cmds
  2610. # Create an old-style archive from a shared archive.
  2611. old_archive_from_new_cmds=$old_archive_from_new_cmds
  2612. # Commands used to build and install a shared archive.
  2613. archive_cmds=$archive_cmds
  2614. archive_expsym_cmds=$archive_expsym_cmds
  2615. postinstall_cmds=$postinstall_cmds
  2616. postuninstall_cmds=$postuninstall_cmds
  2617. # Method to check whether dependent libraries are shared objects.
  2618. deplibs_check_method=$deplibs_check_method
  2619. # Command to use when deplibs_check_method == file_magic.
  2620. file_magic_cmd=$file_magic_cmd
  2621. # Flag that allows shared libraries with undefined symbols to be built.
  2622. allow_undefined_flag=$allow_undefined_flag
  2623. # Flag that forces no undefined symbols.
  2624. no_undefined_flag=$no_undefined_flag
  2625. # Commands used to finish a libtool library installation in a directory.
  2626. finish_cmds=$finish_cmds
  2627. # Same as above, but a single script fragment to be evaled but not shown.
  2628. finish_eval=$finish_eval
  2629. # Take the output of nm and produce a listing of raw symbols and C names.
  2630. global_symbol_pipe=$global_symbol_pipe
  2631. # Transform the output of nm in a proper C declaration
  2632. global_symbol_to_cdecl=$global_symbol_to_cdecl
  2633. # This is the shared library runtime path variable.
  2634. runpath_var=$runpath_var
  2635. # This is the shared library path variable.
  2636. shlibpath_var=$shlibpath_var
  2637. # Is shlibpath searched before the hard-coded library search path?
  2638. shlibpath_overrides_runpath=$shlibpath_overrides_runpath
  2639. # How to hardcode a shared library path into an executable.
  2640. hardcode_action=$hardcode_action
  2641. # Flag to hardcode \$libdir into a binary during linking.
  2642. # This must work even if \$libdir does not exist.
  2643. hardcode_libdir_flag_spec=$hardcode_libdir_flag_spec
  2644. # Whether we need a single -rpath flag with a separated argument.
  2645. hardcode_libdir_separator=$hardcode_libdir_separator
  2646. # Set to yes if using DIR/libNAME.so during linking hardcodes DIR into the
  2647. # resulting binary.
  2648. hardcode_direct=$hardcode_direct
  2649. # Set to yes if using the -LDIR flag during linking hardcodes DIR into the
  2650. # resulting binary.
  2651. hardcode_minus_L=$hardcode_minus_L
  2652. # Set to yes if using SHLIBPATH_VAR=DIR during linking hardcodes DIR into
  2653. # the resulting binary.
  2654. hardcode_shlibpath_var=$hardcode_shlibpath_var
  2655. # Compile-time system search path for libraries
  2656. sys_lib_search_path_spec=$sys_lib_search_path_spec
  2657. # Run-time system search path for libraries
  2658. sys_lib_dlsearch_path_spec=$sys_lib_dlsearch_path_spec
  2659. # Fix the shell variable \$srcfile for the compiler.
  2660. fix_srcfile_path="$fix_srcfile_path"
  2661. # Set to yes if exported symbols are required.
  2662. always_export_symbols=$always_export_symbols
  2663. # The commands to list exported symbols.
  2664. export_symbols_cmds=$export_symbols_cmds
  2665. # Symbols that should not be listed in the preloaded symbols.
  2666. exclude_expsyms=$exclude_expsyms
  2667. # Symbols that must always be exported.
  2668. include_expsyms=$include_expsyms
  2669. EOF
  2670. case "$ltmain" in
  2671. *.sh)
  2672. echo '### END LIBTOOL CONFIG' >> "$ofile"
  2673. echo >> "$ofile"
  2674. case "$host_os" in
  2675. aix3*)
  2676. cat <<\EOF >> "$ofile"
  2677. # AIX sometimes has problems with the GCC collect2 program. For some
  2678. # reason, if we set the COLLECT_NAMES environment variable, the problems
  2679. # vanish in a puff of smoke.
  2680. if test "X${COLLECT_NAMES+set}" != Xset; then
  2681. COLLECT_NAMES=
  2682. export COLLECT_NAMES
  2683. fi
  2684. EOF
  2685. ;;
  2686. esac
  2687. # Append the ltmain.sh script.
  2688. sed '$q' "$ltmain" >> "$ofile" || (rm -f "$ofile"; exit 1)
  2689. # We use sed instead of cat because bash on DJGPP gets confused if
  2690. # if finds mixed CR/LF and LF-only lines. Since sed operates in
  2691. # text mode, it properly converts lines to CR/LF. This bash problem
  2692. # is reportedly fixed, but why not run on old versions too?
  2693. chmod +x "$ofile"
  2694. ;;
  2695. *)
  2696. # Compile the libtool program.
  2697. echo "FIXME: would compile $ltmain"
  2698. ;;
  2699. esac
  2700. test -n "$cache_file" || exit 0
  2701. # AC_CACHE_SAVE
  2702. trap '' 1 2 15
  2703. cat > confcache <<\EOF
  2704. # This file is a shell script that caches the results of configure
  2705. # tests run on this system so they can be shared between configure
  2706. # scripts and configure runs. It is not useful on other systems.
  2707. # If it contains results you don't want to keep, you may remove or edit it.
  2708. #
  2709. # By default, configure uses ./config.cache as the cache file,
  2710. # creating it if it does not exist already. You can give configure
  2711. # the --cache-file=FILE option to use a different cache file; that is
  2712. # what configure does when it calls configure scripts in
  2713. # subdirectories, so they share the cache.
  2714. # Giving --cache-file=/dev/null disables caching, for debugging configure.
  2715. # config.status only pays attention to the cache file if you give it the
  2716. # --recheck option to rerun configure.
  2717. #
  2718. EOF
  2719. # The following way of writing the cache mishandles newlines in values,
  2720. # but we know of no workaround that is simple, portable, and efficient.
  2721. # So, don't put newlines in cache variables' values.
  2722. # Ultrix sh set writes to stderr and can't be redirected directly,
  2723. # and sets the high bit in the cache file unless we assign to the vars.
  2724. (set) 2>&1 |
  2725. case `(ac_space=' '; set | grep ac_space) 2>&1` in
  2726. *ac_space=\ *)
  2727. # `set' does not quote correctly, so add quotes (double-quote substitution
  2728. # turns \\\\ into \\, and sed turns \\ into \).
  2729. sed -n \
  2730. -e "s/'/'\\\\''/g" \
  2731. -e "s/^\\([a-zA-Z0-9_]*_cv_[a-zA-Z0-9_]*\\)=\\(.*\\)/\\1=\${\\1='\\2'}/p"
  2732. ;;
  2733. *)
  2734. # `set' quotes correctly as required by POSIX, so do not add quotes.
  2735. sed -n -e 's/^\([a-zA-Z0-9_]*_cv_[a-zA-Z0-9_]*\)=\(.*\)/\1=${\1=\2}/p'
  2736. ;;
  2737. esac >> confcache
  2738. if cmp -s $cache_file confcache; then
  2739. :
  2740. else
  2741. if test -w $cache_file; then
  2742. echo "updating cache $cache_file"
  2743. cat confcache > $cache_file
  2744. else
  2745. echo "not updating unwritable cache $cache_file"
  2746. fi
  2747. fi
  2748. rm -f confcache
  2749. exit 0
  2750. # Local Variables:
  2751. # mode:shell-script
  2752. # sh-indentation:2
  2753. # End: