ltconfig 85 KB

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