PageRenderTime 188ms CodeModel.GetById 16ms RepoModel.GetById 5ms app.codeStats 0ms

/tags/V_30_88/pfe-30/ltconfig

#
Shell | 2036 lines | 1564 code | 195 blank | 277 comment | 197 complexity | 9bfb26aad0079c1515d445f26d27b1be MD5 | raw file
Possible License(s): Zlib, LGPL-2.0, AGPL-3.0, LGPL-2.1

Large files files are truncated, but you can click here to view the full file

  1. #! /bin/sh
  2. # ltconfig - Create a system-specific libtool.
  3. # Copyright (C) 1996-1999 Free Software Foundation, Inc.
  4. # Originally by Gordon Matzigkeit <gord@gnu.ai.mit.edu>, 1996
  5. #
  6. # This file is free software; you can redistribute it and/or modify it
  7. # under the terms of the GNU General Public License as published by
  8. # the Free Software Foundation; either version 2 of the License, or
  9. # (at your option) any later version.
  10. #
  11. # This program is distributed in the hope that it will be useful, but
  12. # WITHOUT ANY WARRANTY; without even the implied warranty of
  13. # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
  14. # General Public License for more details.
  15. #
  16. # You should have received a copy of the GNU General Public License
  17. # along with this program; if not, write to the Free Software
  18. # Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
  19. #
  20. # As a special exception to the GNU General Public License, if you
  21. # distribute this file as part of a program that contains a
  22. # configuration script generated by Autoconf, you may include it under
  23. # the same distribution terms that you use for the rest of that program.
  24. # A lot of this script is taken from autoconf-2.10.
  25. # Check that we are running under the correct shell.
  26. SHELL=${CONFIG_SHELL-/bin/sh}
  27. echo=echo
  28. if test "X$1" = X--no-reexec; then
  29. # Discard the --no-reexec flag, and continue.
  30. shift
  31. elif test "X$1" = X--fallback-echo; then
  32. # Avoid inline document here, it may be left over
  33. :
  34. elif test "X`($echo '\t') 2>/dev/null`" = 'X\t'; then
  35. # Yippee, $echo works!
  36. :
  37. else
  38. # Restart under the correct shell.
  39. exec "$SHELL" "$0" --no-reexec ${1+"$@"}
  40. fi
  41. if test "X$1" = X--fallback-echo; then
  42. # used as fallback echo
  43. shift
  44. cat <<EOF
  45. $*
  46. EOF
  47. exit 0
  48. fi
  49. # Find the correct PATH separator. Usually this is `:', but
  50. # DJGPP uses `;' like DOS.
  51. if test "X${PATH_SEPARATOR+set}" != "Xset"; then
  52. UNAME=${UNAME-`uname 2>/dev/null`}
  53. case X$UNAME in
  54. *-DOS) PATH_SEPARATOR=';' ;;
  55. *) PATH_SEPARATOR=':' ;;
  56. esac
  57. fi
  58. # The HP-UX ksh and POSIX shell print the target directory to stdout
  59. # if CDPATH is set.
  60. if test "${CDPATH+set}" = set; then CDPATH=; export CDPATH; fi
  61. if test "X${echo_test_string+set}" != "Xset"; then
  62. # find a string as large as possible, as long as the shell can cope with it
  63. for cmd in 'sed 50q "$0"' 'sed 20q "$0"' 'sed 10q "$0"' 'sed 2q "$0"' 'echo test'; do
  64. # expected sizes: less than 2Kb, 1Kb, 512 bytes, 16 bytes, ...
  65. if (echo_test_string="`eval $cmd`") 2>/dev/null &&
  66. echo_test_string="`eval $cmd`" &&
  67. (test "X$echo_test_string" = "X$echo_test_string") 2>/dev/null; then
  68. break
  69. fi
  70. done
  71. fi
  72. if test "X`($echo '\t') 2>/dev/null`" != 'X\t' ||
  73. test "X`($echo "$echo_test_string") 2>/dev/null`" != X"$echo_test_string"; then
  74. # The Solaris, AIX, and Digital Unix default echo programs unquote
  75. # backslashes. This makes it impossible to quote backslashes using
  76. # echo "$something" | sed 's/\\/\\\\/g'
  77. #
  78. # So, first we look for a working echo in the user's PATH.
  79. IFS="${IFS= }"; save_ifs="$IFS"; IFS="${IFS}${PATH_SEPARATOR}"
  80. for dir in $PATH /usr/ucb; do
  81. if (test -f $dir/echo || test -f $dir/echo$ac_exeext) &&
  82. test "X`($dir/echo '\t') 2>/dev/null`" = 'X\t' &&
  83. test "X`($dir/echo "$echo_test_string") 2>/dev/null`" = X"$echo_test_string"; then
  84. echo="$dir/echo"
  85. break
  86. fi
  87. done
  88. IFS="$save_ifs"
  89. if test "X$echo" = Xecho; then
  90. # We didn't find a better echo, so look for alternatives.
  91. if test "X`(print -r '\t') 2>/dev/null`" = 'X\t' &&
  92. test "X`(print -r "$echo_test_string") 2>/dev/null`" = X"$echo_test_string"; then
  93. # This shell has a builtin print -r that does the trick.
  94. echo='print -r'
  95. elif (test -f /bin/ksh || test -f /bin/ksh$ac_exeext) &&
  96. test "X$CONFIG_SHELL" != X/bin/ksh; then
  97. # If we have ksh, try running ltconfig again with it.
  98. ORIGINAL_CONFIG_SHELL="${CONFIG_SHELL-/bin/sh}"
  99. export ORIGINAL_CONFIG_SHELL
  100. CONFIG_SHELL=/bin/ksh
  101. export CONFIG_SHELL
  102. exec "$CONFIG_SHELL" "$0" --no-reexec ${1+"$@"}
  103. else
  104. # Try using printf.
  105. echo='printf "%s\n"'
  106. if test "X`($echo '\t') 2>/dev/null`" = 'X\t' &&
  107. test "X`($echo "$echo_test_string") 2>/dev/null`" = X"$echo_test_string"; then
  108. # Cool, printf works
  109. :
  110. elif test "X`("$ORIGINAL_CONFIG_SHELL" "$0" --fallback-echo '\t') 2>/dev/null`" = 'X\t' &&
  111. test "X`("$ORIGINAL_CONFIG_SHELL" "$0" --fallback-echo "$echo_test_string") 2>/dev/null`" = X"$echo_test_string"; then
  112. CONFIG_SHELL="$ORIGINAL_CONFIG_SHELL"
  113. export CONFIG_SHELL
  114. SHELL="$CONFIG_SHELL"
  115. export SHELL
  116. echo="$CONFIG_SHELL $0 --fallback-echo"
  117. elif test "X`("$CONFIG_SHELL" "$0" --fallback-echo '\t') 2>/dev/null`" = 'X\t' &&
  118. test "X`("$CONFIG_SHELL" "$0" --fallback-echo "$echo_test_string") 2>/dev/null`" = X"$echo_test_string"; then
  119. echo="$CONFIG_SHELL $0 --fallback-echo"
  120. else
  121. # maybe with a smaller string...
  122. prev=:
  123. for cmd in 'echo test' 'sed 2q "$0"' 'sed 10q "$0"' 'sed 20q "$0"' 'sed 50q "$0"'; do
  124. if (test "X$echo_test_string" = "X`eval $cmd`") 2>/dev/null; then
  125. break
  126. fi
  127. prev="$cmd"
  128. done
  129. if test "$prev" != 'sed 50q "$0"'; then
  130. echo_test_string=`eval $prev`
  131. export echo_test_string
  132. exec "${ORIGINAL_CONFIG_SHELL}" "$0" ${1+"$@"}
  133. else
  134. # Oops. We lost completely, so just stick with echo.
  135. echo=echo
  136. fi
  137. fi
  138. fi
  139. fi
  140. fi
  141. # Sed substitution that helps us do robust quoting. It backslashifies
  142. # metacharacters that are still active within double-quoted strings.
  143. Xsed='sed -e s/^X//'
  144. sed_quote_subst='s/\([\\"\\`$\\\\]\)/\\\1/g'
  145. # Same as above, but do not quote variable references.
  146. double_quote_subst='s/\([\\"\\`\\\\]\)/\\\1/g'
  147. # Sed substitution to delay expansion of an escaped shell variable in a
  148. # double_quote_subst'ed string.
  149. delay_variable_subst='s/\\\\\\\\\\\$/\\\\\\$/g'
  150. # The name of this program.
  151. progname=`$echo "X$0" | $Xsed -e 's%^.*/%%'`
  152. # Constants:
  153. PROGRAM=ltconfig
  154. PACKAGE=libtool
  155. VERSION=1.3
  156. TIMESTAMP=" (1.385.2.117 1999/04/29 13:07:13)"
  157. ac_compile='${CC-cc} -c $CFLAGS $CPPFLAGS conftest.c 1>&5'
  158. ac_link='${CC-cc} -o conftest $CFLAGS $CPPFLAGS $LDFLAGS conftest.c $LIBS 1>&5'
  159. rm="rm -f"
  160. help="Try \`$progname --help' for more information."
  161. # Global variables:
  162. default_ofile=libtool
  163. can_build_shared=yes
  164. enable_shared=yes
  165. # All known linkers require a `.a' archive for static linking.
  166. enable_static=yes
  167. enable_fast_install=yes
  168. enable_dlopen=unknown
  169. enable_win32_dll=no
  170. ltmain=
  171. silent=
  172. srcdir=
  173. ac_config_guess=
  174. ac_config_sub=
  175. host=
  176. nonopt=
  177. ofile="$default_ofile"
  178. verify_host=yes
  179. with_gcc=no
  180. with_gnu_ld=no
  181. need_locks=yes
  182. ac_ext=c
  183. objext=o
  184. libext=a
  185. cache_file=
  186. old_AR="$AR"
  187. old_CC="$CC"
  188. old_CFLAGS="$CFLAGS"
  189. old_CPPFLAGS="$CPPFLAGS"
  190. old_LDFLAGS="$LDFLAGS"
  191. old_LD="$LD"
  192. old_LN_S="$LN_S"
  193. old_LIBS="$LIBS"
  194. old_NM="$NM"
  195. old_RANLIB="$RANLIB"
  196. old_DLLTOOL="$DLLTOOL"
  197. old_OBJDUMP="$OBJDUMP"
  198. old_AS="$AS"
  199. # Parse the command line options.
  200. args=
  201. prev=
  202. for option
  203. do
  204. case "$option" in
  205. -*=*) optarg=`echo "$option" | sed 's/[-_a-zA-Z0-9]*=//'` ;;
  206. *) optarg= ;;
  207. esac
  208. # If the previous option needs an argument, assign it.
  209. if test -n "$prev"; then
  210. eval "$prev=\$option"
  211. prev=
  212. continue
  213. fi
  214. case "$option" in
  215. --help) cat <<EOM
  216. Usage: $progname [OPTION]... [HOST [LTMAIN]]
  217. Generate a system-specific libtool script.
  218. --debug enable verbose shell tracing
  219. --disable-shared do not build shared libraries
  220. --disable-static do not build static libraries
  221. --disable-fast-install do not optimize for fast installation
  222. --enable-dlopen enable dlopen support
  223. --enable-win32-dll enable building dlls on win32 hosts
  224. --help display this help and exit
  225. --no-verify do not verify that HOST is a valid host type
  226. -o, --output=FILE specify the output file [default=$default_ofile]
  227. --quiet same as \`--silent'
  228. --silent do not print informational messages
  229. --srcdir=DIR find \`config.guess' in DIR
  230. --version output version information and exit
  231. --with-gcc assume that the GNU C compiler will be used
  232. --with-gnu-ld assume that the C compiler uses the GNU linker
  233. --disable-lock disable file locking
  234. --cache-file=FILE configure cache file
  235. LTMAIN is the \`ltmain.sh' shell script fragment or \`ltmain.c' program
  236. that provides basic libtool functionality.
  237. HOST is the canonical host system name [default=guessed].
  238. EOM
  239. exit 0
  240. ;;
  241. --debug)
  242. echo "$progname: enabling shell trace mode"
  243. set -x
  244. ;;
  245. --disable-shared) enable_shared=no ;;
  246. --disable-static) enable_static=no ;;
  247. --disable-fast-install) enable_fast_install=no ;;
  248. --enable-dlopen) enable_dlopen=yes ;;
  249. --enable-win32-dll) enable_win32_dll=yes ;;
  250. --quiet | --silent) silent=yes ;;
  251. --srcdir) prev=srcdir ;;
  252. --srcdir=*) srcdir="$optarg" ;;
  253. --no-verify) verify_host=no ;;
  254. --output | -o) prev=ofile ;;
  255. --output=*) ofile="$optarg" ;;
  256. --version) echo "$PROGRAM (GNU $PACKAGE) $VERSION$TIMESTAMP"; exit 0 ;;
  257. --with-gcc) with_gcc=yes ;;
  258. --with-gnu-ld) with_gnu_ld=yes ;;
  259. --disable-lock) need_locks=no ;;
  260. --cache-file=*) cache_file="$optarg" ;;
  261. -*)
  262. echo "$progname: unrecognized option \`$option'" 1>&2
  263. echo "$help" 1>&2
  264. exit 1
  265. ;;
  266. *)
  267. if test -z "$ltmain"; then
  268. ltmain="$option"
  269. elif test -z "$host"; then
  270. # This generates an unnecessary warning for sparc-sun-solaris4.1.3_U1
  271. # if test -n "`echo $option| sed 's/[-a-z0-9.]//g'`"; then
  272. # echo "$progname: warning \`$option' is not a valid host type" 1>&2
  273. # fi
  274. host="$option"
  275. else
  276. echo "$progname: too many arguments" 1>&2
  277. echo "$help" 1>&2
  278. exit 1
  279. fi ;;
  280. esac
  281. done
  282. if test -z "$ltmain"; then
  283. echo "$progname: you must specify a LTMAIN file" 1>&2
  284. echo "$help" 1>&2
  285. exit 1
  286. fi
  287. if test ! -f "$ltmain"; then
  288. echo "$progname: \`$ltmain' does not exist" 1>&2
  289. echo "$help" 1>&2
  290. exit 1
  291. fi
  292. # Quote any args containing shell metacharacters.
  293. ltconfig_args=
  294. for arg
  295. do
  296. case "$arg" in
  297. *" "*|*" "*|*[\[\]\~\#\$\^\&\*\(\)\{\}\\\|\;\<\>\?]*)
  298. ltconfig_args="$ltconfig_args '$arg'" ;;
  299. *) ltconfig_args="$ltconfig_args $arg" ;;
  300. esac
  301. done
  302. # A relevant subset of AC_INIT.
  303. # File descriptor usage:
  304. # 0 standard input
  305. # 1 file creation
  306. # 2 errors and warnings
  307. # 3 some systems may open it to /dev/tty
  308. # 4 used on the Kubota Titan
  309. # 5 compiler messages saved in config.log
  310. # 6 checking for... messages and results
  311. if test "$silent" = yes; then
  312. exec 6>/dev/null
  313. else
  314. exec 6>&1
  315. fi
  316. exec 5>>./config.log
  317. # NLS nuisances.
  318. # Only set LANG and LC_ALL to C if already set.
  319. # These must not be set unconditionally because not all systems understand
  320. # e.g. LANG=C (notably SCO).
  321. if test "${LC_ALL+set}" = set; then LC_ALL=C; export LC_ALL; fi
  322. if test "${LANG+set}" = set; then LANG=C; export LANG; fi
  323. if test -n "$cache_file" && test -r "$cache_file"; then
  324. echo "loading cache $cache_file within ltconfig"
  325. . $cache_file
  326. fi
  327. if (echo "testing\c"; echo 1,2,3) | grep c >/dev/null; then
  328. # Stardent Vistra SVR4 grep lacks -e, says ghazi@caip.rutgers.edu.
  329. if (echo -n testing; echo 1,2,3) | sed s/-n/xn/ | grep xn >/dev/null; then
  330. ac_n= ac_c='
  331. ' ac_t=' '
  332. else
  333. ac_n=-n ac_c= ac_t=
  334. fi
  335. else
  336. ac_n= ac_c='\c' ac_t=
  337. fi
  338. if test -z "$srcdir"; then
  339. # Assume the source directory is the same one as the path to LTMAIN.
  340. srcdir=`$echo "X$ltmain" | $Xsed -e 's%/[^/]*$%%'`
  341. test "$srcdir" = "$ltmain" && srcdir=.
  342. fi
  343. trap "$rm conftest*; exit 1" 1 2 15
  344. if test "$verify_host" = yes; then
  345. # Check for config.guess and config.sub.
  346. ac_aux_dir=
  347. for ac_dir in $srcdir $srcdir/.. $srcdir/../..; do
  348. if test -f $ac_dir/config.guess; then
  349. ac_aux_dir=$ac_dir
  350. break
  351. fi
  352. done
  353. if test -z "$ac_aux_dir"; then
  354. echo "$progname: cannot find config.guess in $srcdir $srcdir/.. $srcdir/../.." 1>&2
  355. echo "$help" 1>&2
  356. exit 1
  357. fi
  358. ac_config_guess=$ac_aux_dir/config.guess
  359. ac_config_sub=$ac_aux_dir/config.sub
  360. # Make sure we can run config.sub.
  361. if $SHELL $ac_config_sub sun4 >/dev/null 2>&1; then :
  362. else
  363. echo "$progname: cannot run $ac_config_sub" 1>&2
  364. echo "$help" 1>&2
  365. exit 1
  366. fi
  367. echo $ac_n "checking host system type""... $ac_c" 1>&6
  368. host_alias=$host
  369. case "$host_alias" in
  370. "")
  371. if host_alias=`$SHELL $ac_config_guess`; then :
  372. else
  373. echo "$progname: cannot guess host type; you must specify one" 1>&2
  374. echo "$help" 1>&2
  375. exit 1
  376. fi ;;
  377. esac
  378. host=`$SHELL $ac_config_sub $host_alias`
  379. echo "$ac_t$host" 1>&6
  380. # Make sure the host verified.
  381. test -z "$host" && exit 1
  382. elif test -z "$host"; then
  383. echo "$progname: you must specify a host type if you use \`--no-verify'" 1>&2
  384. echo "$help" 1>&2
  385. exit 1
  386. else
  387. host_alias=$host
  388. fi
  389. # Transform linux* to *-*-linux-gnu*, to support old configure scripts.
  390. case "$host_os" in
  391. linux-gnu*) ;;
  392. linux*) host=`echo $host | sed 's/^\(.*-.*-linux\)\(.*\)$/\1-gnu\2/'`
  393. esac
  394. host_cpu=`echo $host | sed 's/^\([^-]*\)-\([^-]*\)-\(.*\)$/\1/'`
  395. host_vendor=`echo $host | sed 's/^\([^-]*\)-\([^-]*\)-\(.*\)$/\2/'`
  396. host_os=`echo $host | sed 's/^\([^-]*\)-\([^-]*\)-\(.*\)$/\3/'`
  397. case "$host_os" in
  398. aix3*)
  399. # AIX sometimes has problems with the GCC collect2 program. For some
  400. # reason, if we set the COLLECT_NAMES environment variable, the problems
  401. # vanish in a puff of smoke.
  402. if test "${COLLECT_NAMES+set}" != set; then
  403. COLLECT_NAMES=
  404. export COLLECT_NAMES
  405. fi
  406. ;;
  407. esac
  408. # Determine commands to create old-style static archives.
  409. old_archive_cmds='$AR cru $oldlib$oldobjs'
  410. old_postinstall_cmds='chmod 644 $oldlib'
  411. old_postuninstall_cmds=
  412. # Set a sane default for `AR'.
  413. test -z "$AR" && AR=ar
  414. # Set a sane default for `OBJDUMP'.
  415. test -z "$OBJDUMP" && OBJDUMP=objdump
  416. # If RANLIB is not set, then run the test.
  417. if test "${RANLIB+set}" != "set"; then
  418. result=no
  419. echo $ac_n "checking for ranlib... $ac_c" 1>&6
  420. IFS="${IFS= }"; save_ifs="$IFS"; IFS="${IFS}${PATH_SEPARATOR}"
  421. for dir in $PATH; do
  422. test -z "$dir" && dir=.
  423. if test -f $dir/ranlib || test -f $dir/ranlib$ac_exeext; then
  424. RANLIB="ranlib"
  425. result="ranlib"
  426. break
  427. fi
  428. done
  429. IFS="$save_ifs"
  430. echo "$ac_t$result" 1>&6
  431. fi
  432. if test -n "$RANLIB"; then
  433. old_archive_cmds="$old_archive_cmds~\$RANLIB \$oldlib"
  434. old_postinstall_cmds="\$RANLIB \$oldlib~$old_postinstall_cmds"
  435. fi
  436. # Set sane defaults for `DLLTOOL', `OBJDUMP', and `AS', used on cygwin.
  437. test -z "$DLLTOOL" && DLLTOOL=dlltool
  438. test -z "$OBJDUMP" && OBJDUMP=objdump
  439. test -z "$AS" && AS=as
  440. # Check to see if we are using GCC.
  441. if test "$with_gcc" != yes || test -z "$CC"; then
  442. # If CC is not set, then try to find GCC or a usable CC.
  443. if test -z "$CC"; then
  444. echo $ac_n "checking for gcc... $ac_c" 1>&6
  445. IFS="${IFS= }"; save_ifs="$IFS"; IFS="${IFS}${PATH_SEPARATOR}"
  446. for dir in $PATH; do
  447. test -z "$dir" && dir=.
  448. if test -f $dir/gcc || test -f $dir/gcc$ac_exeext; then
  449. CC="gcc"
  450. break
  451. fi
  452. done
  453. IFS="$save_ifs"
  454. if test -n "$CC"; then
  455. echo "$ac_t$CC" 1>&6
  456. else
  457. echo "$ac_t"no 1>&6
  458. fi
  459. fi
  460. # Not "gcc", so try "cc", rejecting "/usr/ucb/cc".
  461. if test -z "$CC"; then
  462. echo $ac_n "checking for cc... $ac_c" 1>&6
  463. IFS="${IFS= }"; save_ifs="$IFS"; IFS="${IFS}${PATH_SEPARATOR}"
  464. cc_rejected=no
  465. for dir in $PATH; do
  466. test -z "$dir" && dir=.
  467. if test -f $dir/cc || test -f $dir/cc$ac_exeext; then
  468. if test "$dir/cc" = "/usr/ucb/cc"; then
  469. cc_rejected=yes
  470. continue
  471. fi
  472. CC="cc"
  473. break
  474. fi
  475. done
  476. IFS="$save_ifs"
  477. if test $cc_rejected = yes; then
  478. # We found a bogon in the path, so make sure we never use it.
  479. set dummy $CC
  480. shift
  481. if test $# -gt 0; then
  482. # We chose a different compiler from the bogus one.
  483. # However, it has the same name, so the bogon will be chosen
  484. # first if we set CC to just the name; use the full file name.
  485. shift
  486. set dummy "$dir/cc" "$@"
  487. shift
  488. CC="$@"
  489. fi
  490. fi
  491. if test -n "$CC"; then
  492. echo "$ac_t$CC" 1>&6
  493. else
  494. echo "$ac_t"no 1>&6
  495. fi
  496. if test -z "$CC"; then
  497. echo "$progname: error: no acceptable cc found in \$PATH" 1>&2
  498. exit 1
  499. fi
  500. fi
  501. # Now see if the compiler is really GCC.
  502. with_gcc=no
  503. echo $ac_n "checking whether we are using GNU C... $ac_c" 1>&6
  504. echo "$progname:579: checking whether we are using GNU C" >&5
  505. $rm conftest.c
  506. cat > conftest.c <<EOF
  507. #ifdef __GNUC__
  508. yes;
  509. #endif
  510. EOF
  511. if { ac_try='${CC-cc} -E conftest.c'; { (eval echo $progname:587: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }; } | egrep yes >/dev/null 2>&1; then
  512. with_gcc=yes
  513. fi
  514. $rm conftest.c
  515. echo "$ac_t$with_gcc" 1>&6
  516. fi
  517. # Allow CC to be a program name with arguments.
  518. set dummy $CC
  519. compiler="$2"
  520. echo $ac_n "checking for object suffix... $ac_c" 1>&6
  521. $rm conftest*
  522. echo 'int i = 1;' > conftest.c
  523. echo "$progname:601: checking for object suffix" >& 5
  524. if { (eval echo $progname:602: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>conftest.err; }; then
  525. # Append any warnings to the config.log.
  526. cat conftest.err 1>&5
  527. for ac_file in conftest.*; do
  528. case $ac_file in
  529. *.c) ;;
  530. *) objext=`echo $ac_file | sed -e s/conftest.//` ;;
  531. esac
  532. done
  533. else
  534. cat conftest.err 1>&5
  535. echo "$progname: failed program was:" >&5
  536. cat conftest.c >&5
  537. fi
  538. $rm conftest*
  539. echo "$ac_t$objext" 1>&6
  540. echo $ac_n "checking for $compiler option to produce PIC... $ac_c" 1>&6
  541. pic_flag=
  542. special_shlib_compile_flags=
  543. wl=
  544. link_static_flag=
  545. no_builtin_flag=
  546. if test "$with_gcc" = yes; then
  547. wl='-Wl,'
  548. link_static_flag='-static'
  549. case "$host_os" in
  550. beos* | irix5* | irix6* | osf3* | osf4*)
  551. # PIC is the default for these OSes.
  552. ;;
  553. aix*)
  554. # Below there is a dirty hack to force normal static linking with -ldl
  555. # The problem is because libdl dynamically linked with both libc and
  556. # libC (AIX C++ library), which obviously doesn't included in libraries
  557. # list by gcc. This cause undefined symbols with -static flags.
  558. # This hack allows C programs to be linked with "-static -ldl", but
  559. # we not sure about C++ programs.
  560. link_static_flag="$link_static_flag ${wl}-lC"
  561. ;;
  562. cygwin* | mingw* | os2*)
  563. # We can build DLLs from non-PIC.
  564. ;;
  565. amigaos*)
  566. # FIXME: we need at least 68020 code to build shared libraries, but
  567. # adding the `-m68020' flag to GCC prevents building anything better,
  568. # like `-m68040'.
  569. pic_flag='-m68020 -resident32 -malways-restore-a4'
  570. ;;
  571. *)
  572. pic_flag='-fPIC'
  573. ;;
  574. esac
  575. else
  576. # PORTME Check for PIC flags for the system compiler.
  577. case "$host_os" in
  578. aix3* | aix4*)
  579. # All AIX code is PIC.
  580. link_static_flag='-bnso -bI:/lib/syscalls.exp'
  581. ;;
  582. hpux9* | hpux10* | hpux11*)
  583. # Is there a better link_static_flag that works with the bundled CC?
  584. wl='-Wl,'
  585. link_static_flag="${wl}-a ${wl}archive"
  586. pic_flag='+Z'
  587. ;;
  588. irix5* | irix6*)
  589. wl='-Wl,'
  590. link_static_flag='-non_shared'
  591. # PIC (with -KPIC) is the default.
  592. ;;
  593. cygwin* | mingw* | os2*)
  594. # We can build DLLs from non-PIC.
  595. ;;
  596. osf3* | osf4*)
  597. # All OSF/1 code is PIC.
  598. wl='-Wl,'
  599. link_static_flag='-non_shared'
  600. ;;
  601. sco3.2v5*)
  602. pic_flag='-Kpic'
  603. link_static_flag='-dn'
  604. special_shlib_compile_flags='-belf'
  605. ;;
  606. solaris*)
  607. pic_flag='-KPIC'
  608. link_static_flag='-Bstatic'
  609. wl='-Wl,'
  610. ;;
  611. sunos4*)
  612. pic_flag='-PIC'
  613. link_static_flag='-Bstatic'
  614. wl='-Qoption ld '
  615. ;;
  616. sysv4 | sysv4.2uw2* | sysv4.3* | sysv5*)
  617. pic_flag='-KPIC'
  618. link_static_flag='-Bstatic'
  619. wl='-Wl,'
  620. ;;
  621. uts4*)
  622. pic_flag='-pic'
  623. link_static_flag='-Bstatic'
  624. ;;
  625. *)
  626. can_build_shared=no
  627. ;;
  628. esac
  629. fi
  630. if test -n "$pic_flag"; then
  631. echo "$ac_t$pic_flag" 1>&6
  632. # Check to make sure the pic_flag actually works.
  633. echo $ac_n "checking if $compiler PIC flag $pic_flag works... $ac_c" 1>&6
  634. $rm conftest*
  635. echo "int some_variable = 0;" > conftest.c
  636. save_CFLAGS="$CFLAGS"
  637. CFLAGS="$CFLAGS $pic_flag -DPIC"
  638. echo "$progname:732: checking if $compiler PIC flag $pic_flag works" >&5
  639. if { (eval echo $progname:733: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>conftest.err; } && test -s conftest.$objext; then
  640. # Append any warnings to the config.log.
  641. cat conftest.err 1>&5
  642. case "$host_os" in
  643. hpux9* | hpux10* | hpux11*)
  644. # On HP-UX, both CC and GCC only warn that PIC is supported... then they
  645. # create non-PIC objects. So, if there were any warnings, we assume that
  646. # PIC is not supported.
  647. if test -s conftest.err; then
  648. echo "$ac_t"no 1>&6
  649. can_build_shared=no
  650. pic_flag=
  651. else
  652. echo "$ac_t"yes 1>&6
  653. pic_flag=" $pic_flag"
  654. fi
  655. ;;
  656. *)
  657. echo "$ac_t"yes 1>&6
  658. pic_flag=" $pic_flag"
  659. ;;
  660. esac
  661. else
  662. # Append any errors to the config.log.
  663. cat conftest.err 1>&5
  664. can_build_shared=no
  665. pic_flag=
  666. echo "$ac_t"no 1>&6
  667. fi
  668. CFLAGS="$save_CFLAGS"
  669. $rm conftest*
  670. else
  671. echo "$ac_t"none 1>&6
  672. fi
  673. # Check to see if options -o and -c are simultaneously supported by compiler
  674. echo $ac_n "checking if $compiler supports -c -o file.o... $ac_c" 1>&6
  675. $rm -r conftest 2>/dev/null
  676. mkdir conftest
  677. cd conftest
  678. $rm conftest*
  679. echo "int some_variable = 0;" > conftest.c
  680. mkdir out
  681. # According to Tom Tromey, Ian Lance Taylor reported there are C compilers
  682. # that will create temporary files in the current directory regardless of
  683. # the output directory. Thus, making CWD read-only will cause this test
  684. # to fail, enabling locking or at least warning the user not to do parallel
  685. # builds.
  686. chmod -w .
  687. save_CFLAGS="$CFLAGS"
  688. CFLAGS="$CFLAGS -o out/conftest2.o"
  689. echo "$progname:785: checking if $compiler supports -c -o file.o" >&5
  690. if { (eval echo $progname:786: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>out/conftest.err; } && test -s out/conftest2.o; then
  691. # The compiler can only warn and ignore the option if not recognized
  692. # So say no if there are warnings
  693. if test -s out/conftest.err; then
  694. echo "$ac_t"no 1>&6
  695. compiler_c_o=no
  696. else
  697. echo "$ac_t"yes 1>&6
  698. compiler_c_o=yes
  699. fi
  700. else
  701. # Append any errors to the config.log.
  702. cat out/conftest.err 1>&5
  703. compiler_c_o=no
  704. echo "$ac_t"no 1>&6
  705. fi
  706. CFLAGS="$save_CFLAGS"
  707. chmod u+w .
  708. $rm conftest* out/*
  709. rmdir out
  710. cd ..
  711. rmdir conftest
  712. $rm -r conftest 2>/dev/null
  713. if test x"$compiler_c_o" = x"yes"; then
  714. # Check to see if we can write to a .lo
  715. echo $ac_n "checking if $compiler supports -c -o file.lo... $ac_c" 1>&6
  716. $rm conftest*
  717. echo "int some_variable = 0;" > conftest.c
  718. save_CFLAGS="$CFLAGS"
  719. CFLAGS="$CFLAGS -c -o conftest.lo"
  720. echo "$progname:818: checking if $compiler supports -c -o file.lo" >&5
  721. if { (eval echo $progname:819: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>conftest.err; } && test -s conftest.lo; then
  722. # The compiler can only warn and ignore the option if not recognized
  723. # So say no if there are warnings
  724. if test -s conftest.err; then
  725. echo "$ac_t"no 1>&6
  726. compiler_o_lo=no
  727. else
  728. echo "$ac_t"yes 1>&6
  729. compiler_o_lo=yes
  730. fi
  731. else
  732. # Append any errors to the config.log.
  733. cat conftest.err 1>&5
  734. compiler_o_lo=no
  735. echo "$ac_t"no 1>&6
  736. fi
  737. CFLAGS="$save_CFLAGS"
  738. $rm conftest*
  739. else
  740. compiler_o_lo=no
  741. fi
  742. # Check to see if we can do hard links to lock some files if needed
  743. hard_links="nottested"
  744. if test "$compiler_c_o" = no && test "$need_locks" != no; then
  745. # do not overwrite the value of need_locks provided by the user
  746. echo $ac_n "checking if we can lock with hard links... $ac_c" 1>&6
  747. hard_links=yes
  748. $rm conftest*
  749. ln conftest.a conftest.b 2>/dev/null && hard_links=no
  750. touch conftest.a
  751. ln conftest.a conftest.b 2>&5 || hard_links=no
  752. ln conftest.a conftest.b 2>/dev/null && hard_links=no
  753. echo "$ac_t$hard_links" 1>&6
  754. $rm conftest*
  755. if test "$hard_links" = no; then
  756. echo "*** WARNING: \`$CC' does not support \`-c -o', so \`make -j' may be unsafe" >&2
  757. need_locks=warn
  758. fi
  759. else
  760. need_locks=no
  761. fi
  762. if test "$with_gcc" = yes; then
  763. # Check to see if options -fno-rtti -fno-exceptions are supported by compiler
  764. echo $ac_n "checking if $compiler supports -fno-rtti -fno-exceptions ... $ac_c" 1>&6
  765. $rm conftest*
  766. echo "int some_variable = 0;" > conftest.c
  767. save_CFLAGS="$CFLAGS"
  768. CFLAGS="$CFLAGS -fno-rtti -fno-exceptions -c conftest.c"
  769. echo "$progname:870: checking if $compiler supports -fno-rtti -fno-exceptions" >&5
  770. if { (eval echo $progname:871: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>conftest.err; } && test -s conftest.o; then
  771. # The compiler can only warn and ignore the option if not recognized
  772. # So say no if there are warnings
  773. if test -s conftest.err; then
  774. echo "$ac_t"no 1>&6
  775. compiler_rtti_exceptions=no
  776. else
  777. echo "$ac_t"yes 1>&6
  778. compiler_rtti_exceptions=yes
  779. fi
  780. else
  781. # Append any errors to the config.log.
  782. cat conftest.err 1>&5
  783. compiler_rtti_exceptions=no
  784. echo "$ac_t"no 1>&6
  785. fi
  786. CFLAGS="$save_CFLAGS"
  787. $rm conftest*
  788. if test "$compiler_rtti_exceptions" = "yes"; then
  789. no_builtin_flag=' -fno-builtin -fno-rtti -fno-exceptions'
  790. else
  791. no_builtin_flag=' -fno-builtin'
  792. fi
  793. fi
  794. # Check for any special shared library compilation flags.
  795. if test -n "$special_shlib_compile_flags"; then
  796. echo "$progname: warning: \`$CC' requires \`$special_shlib_compile_flags' to build shared libraries" 1>&2
  797. if echo "$old_CC $old_CFLAGS " | egrep -e "[ ]$special_shlib_compile_flags[ ]" >/dev/null; then :
  798. else
  799. echo "$progname: add \`$special_shlib_compile_flags' to the CC or CFLAGS env variable and reconfigure" 1>&2
  800. can_build_shared=no
  801. fi
  802. fi
  803. echo $ac_n "checking if $compiler static flag $link_static_flag works... $ac_c" 1>&6
  804. $rm conftest*
  805. echo 'main(){return(0);}' > conftest.c
  806. save_LDFLAGS="$LDFLAGS"
  807. LDFLAGS="$LDFLAGS $link_static_flag"
  808. echo "$progname:914: checking if $compiler static flag $link_static_flag works" >&5
  809. if { (eval echo $progname:915: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest; then
  810. echo "$ac_t$link_static_flag" 1>&6
  811. else
  812. echo "$ac_t"none 1>&6
  813. link_static_flag=
  814. fi
  815. LDFLAGS="$save_LDFLAGS"
  816. $rm conftest*
  817. if test -z "$LN_S"; then
  818. # Check to see if we can use ln -s, or we need hard links.
  819. echo $ac_n "checking whether ln -s works... $ac_c" 1>&6
  820. $rm conftest.dat
  821. if ln -s X conftest.dat 2>/dev/null; then
  822. $rm conftest.dat
  823. LN_S="ln -s"
  824. else
  825. LN_S=ln
  826. fi
  827. if test "$LN_S" = "ln -s"; then
  828. echo "$ac_t"yes 1>&6
  829. else
  830. echo "$ac_t"no 1>&6
  831. fi
  832. fi
  833. # Make sure LD is an absolute path.
  834. if test -z "$LD"; then
  835. ac_prog=ld
  836. if test "$with_gcc" = yes; then
  837. # Check if gcc -print-prog-name=ld gives a path.
  838. echo $ac_n "checking for ld used by GCC... $ac_c" 1>&6
  839. echo "$progname:947: checking for ld used by GCC" >&5
  840. ac_prog=`($CC -print-prog-name=ld) 2>&5`
  841. case "$ac_prog" in
  842. # Accept absolute paths.
  843. [\\/]* | [A-Za-z]:[\\/]*)
  844. re_direlt='/[^/][^/]*/\.\./'
  845. # Canonicalize the path of ld
  846. ac_prog=`echo $ac_prog| sed 's%\\\\%/%g'`
  847. while echo $ac_prog | grep "$re_direlt" > /dev/null 2>&1; do
  848. ac_prog=`echo $ac_prog| sed "s%$re_direlt%/%"`
  849. done
  850. test -z "$LD" && LD="$ac_prog"
  851. ;;
  852. "")
  853. # If it fails, then pretend we are not using GCC.
  854. ac_prog=ld
  855. ;;
  856. *)
  857. # If it is relative, then search for the first ld in PATH.
  858. with_gnu_ld=unknown
  859. ;;
  860. esac
  861. elif test "$with_gnu_ld" = yes; then
  862. echo $ac_n "checking for GNU ld... $ac_c" 1>&6
  863. echo "$progname:971: checking for GNU ld" >&5
  864. else
  865. echo $ac_n "checking for non-GNU ld""... $ac_c" 1>&6
  866. echo "$progname:974: checking for non-GNU ld" >&5
  867. fi
  868. if test -z "$LD"; then
  869. IFS="${IFS= }"; ac_save_ifs="$IFS"; IFS="${IFS}${PATH_SEPARATOR}"
  870. for ac_dir in $PATH; do
  871. test -z "$ac_dir" && ac_dir=.
  872. if test -f "$ac_dir/$ac_prog" || test -f "$ac_dir/$ac_prog$ac_exeext"; then
  873. LD="$ac_dir/$ac_prog"
  874. # Check to see if the program is GNU ld. I'd rather use --version,
  875. # but apparently some GNU ld's only accept -v.
  876. # Break only if it was the GNU/non-GNU ld that we prefer.
  877. if "$LD" -v 2>&1 < /dev/null | egrep '(GNU|with BFD)' > /dev/null; then
  878. test "$with_gnu_ld" != no && break
  879. else
  880. test "$with_gnu_ld" != yes && break
  881. fi
  882. fi
  883. done
  884. IFS="$ac_save_ifs"
  885. fi
  886. if test -n "$LD"; then
  887. echo "$ac_t$LD" 1>&6
  888. else
  889. echo "$ac_t"no 1>&6
  890. fi
  891. if test -z "$LD"; then
  892. echo "$progname: error: no acceptable ld found in \$PATH" 1>&2
  893. exit 1
  894. fi
  895. fi
  896. # Check to see if it really is or is not GNU ld.
  897. echo $ac_n "checking if the linker ($LD) is GNU ld... $ac_c" 1>&6
  898. # I'd rather use --version here, but apparently some GNU ld's only accept -v.
  899. if $LD -v 2>&1 </dev/null | egrep '(GNU|with BFD)' 1>&5; then
  900. with_gnu_ld=yes
  901. else
  902. with_gnu_ld=no
  903. fi
  904. echo "$ac_t$with_gnu_ld" 1>&6
  905. # See if the linker supports building shared libraries.
  906. echo $ac_n "checking whether the linker ($LD) supports shared libraries... $ac_c" 1>&6
  907. allow_undefined_flag=
  908. no_undefined_flag=
  909. need_lib_prefix=unknown
  910. need_version=unknown
  911. # when you set need_version to no, make sure it does not cause -set_version
  912. # flags to be left without arguments
  913. archive_cmds=
  914. archive_expsym_cmds=
  915. old_archive_from_new_cmds=
  916. export_dynamic_flag_spec=
  917. whole_archive_flag_spec=
  918. thread_safe_flag_spec=
  919. hardcode_libdir_flag_spec=
  920. hardcode_libdir_separator=
  921. hardcode_direct=no
  922. hardcode_minus_L=no
  923. hardcode_shlibpath_var=unsupported
  924. runpath_var=
  925. always_export_symbols=no
  926. export_symbols_cmds='$NM $libobjs | $global_symbol_pipe | sed '\''s/.* //'\'' | sort | uniq > $export_symbols'
  927. # include_expsyms should be a list of space-separated symbols to be *always*
  928. # included in the symbol list
  929. include_expsyms=
  930. # exclude_expsyms can be an egrep regular expression of symbols to exclude
  931. # it will be wrapped by ` (' and `)$', so one must not match beginning or
  932. # end of line. Example: `a|bc|.*d.*' will exclude the symbols `a' and `bc',
  933. # as well as any symbol that contains `d'.
  934. exclude_expsyms="_GLOBAL_OFFSET_TABLE_"
  935. # Although _GLOBAL_OFFSET_TABLE_ is a valid symbol C name, most a.out
  936. # platforms (ab)use it in PIC code, but their linkers get confused if
  937. # the symbol is explicitly referenced. Since portable code cannot
  938. # rely on this symbol name, it's probably fine to never include it in
  939. # preloaded symbol tables.
  940. case "$host_os" in
  941. cygwin* | mingw*)
  942. # FIXME: the MSVC++ port hasn't been tested in a loooong time
  943. # When not using gcc, we currently assume that we are using
  944. # Microsoft Visual C++.
  945. if test "$with_gcc" != yes; then
  946. with_gnu_ld=no
  947. fi
  948. ;;
  949. esac
  950. ld_shlibs=yes
  951. if test "$with_gnu_ld" = yes; then
  952. # If archive_cmds runs LD, not CC, wlarc should be empty
  953. wlarc='${wl}'
  954. # See if GNU ld supports shared libraries.
  955. case "$host_os" in
  956. aix3* | aix4*)
  957. # On AIX, the GNU linker is very broken
  958. ld_shlibs=no
  959. cat <<EOF 1>&2
  960. *** Warning: the GNU linker, at least up to release 2.9.1, is reported
  961. *** to be unable to reliably create shared libraries on AIX.
  962. *** Therefore, libtool is disabling shared libraries support. If you
  963. *** really care for shared libraries, you may want to modify your PATH
  964. *** so that a non-GNU linker is found, and then restart.
  965. EOF
  966. ;;
  967. amigaos*)
  968. archive_cmds='$rm $objdir/a2ixlibrary.data~$echo "#define NAME $libname" > $objdir/a2ixlibrary.data~$echo "#define LIBRARY_ID 1" >> $objdir/a2ixlibrary.data~$echo "#define VERSION $major" >> $objdir/a2ixlibrary.data~$echo "#define REVISION $revision" >> $objdir/a2ixlibrary.data~$AR cru $lib $libobjs~$RANLIB $lib~(cd $objdir && a2ixlibrary -32)'
  969. hardcode_libdir_flag_spec='-L$libdir'
  970. hardcode_minus_L=yes
  971. # Samuel A. Falvo II <kc5tja@dolphin.openprojects.net> reports
  972. # that the semantics of dynamic libraries on AmigaOS, at least up
  973. # to version 4, is to share data among multiple programs linked
  974. # with the same dynamic library. Since this doesn't match the
  975. # behavior of shared libraries on other platforms, we can use
  976. # them.
  977. ld_shlibs=no
  978. ;;
  979. beos*)
  980. if $LD --help 2>&1 | egrep ': supported targets:.* elf' > /dev/null; then
  981. allow_undefined_flag=unsupported
  982. # Joseph Beckenbach <jrb3@best.com> says some releases of gcc
  983. # support --undefined. This deserves some investigation. FIXME
  984. archive_cmds='$CC -nostart $libobjs $deplibs $linkopts ${wl}-soname $wl$soname -o $lib'
  985. else
  986. ld_shlibs=no
  987. fi
  988. ;;
  989. cygwin* | mingw*)
  990. # hardcode_libdir_flag_spec is actually meaningless, as there is
  991. # no search path for DLLs.
  992. hardcode_libdir_flag_spec='-L$libdir'
  993. allow_undefined_flag=unsupported
  994. always_export_symbols=yes
  995. # Extract the symbol export list from an `--export-all' def file,
  996. # then regenerate the def file from the symbol export list, so that
  997. # the compiled dll only exports the symbol export list.
  998. export_symbols_cmds='rm -f $objdir/$soname-ltdll.c~
  999. sed -e "/^# \/\* ltdll\.c starts here \*\//,/^# \/\* ltdll.c ends here \*\// { s/^# //; p; }" -e d < $0 > $objdir/$soname-ltdll.c~
  1000. (cd $objdir && $CC -c $soname-ltdll.c)~
  1001. $DLLTOOL --export-all --exclude-symbols DllMain@12,_cygwin_dll_entry@12,_cygwin_noncygwin_dll_entry@12 --output-def $objdir/$soname-def $objdir/$soname-ltdll.$objext $libobjs~
  1002. sed -e "1,/EXPORTS/d" -e "s/ @ [0-9]* ; *//" < $objdir/$soname-def > $export_symbols'
  1003. archive_expsym_cmds='echo EXPORTS > $objdir/$soname-def~
  1004. _lt_hint=1;
  1005. for symbol in `cat $export_symbols`; do
  1006. echo " \$symbol @ \$_lt_hint ; " >> $objdir/$soname-def;
  1007. _lt_hint=`expr 1 + \$_lt_hint`;
  1008. done~
  1009. $CC -Wl,--base-file,$objdir/$soname-base -Wl,--dll -nostartfiles -Wl,-e,__cygwin_dll_entry@12 -o $lib $objdir/$soname-ltdll.$objext $libobjs $deplibs $linkopts~
  1010. $DLLTOOL --as=$AS --dllname $soname --exclude-symbols DllMain@12,_cygwin_dll_entry@12,_cygwin_noncygwin_dll_entry@12 --def $objdir/$soname-def --base-file $objdir/$soname-base --output-exp $objdir/$soname-exp~
  1011. $CC -Wl,--base-file,$objdir/$soname-base $objdir/$soname-exp -Wl,--dll -nostartfiles -Wl,-e,__cygwin_dll_entry@12 -o $lib $objdir/$soname-ltdll.$objext $libobjs $deplibs $linkopts~
  1012. $DLLTOOL --as=$AS --dllname $soname --exclude-symbols DllMain@12,_cygwin_dll_entry@12,_cygwin_noncygwin_dll_entry@12 --def $objdir/$soname-def --base-file $objdir/$soname-base --output-exp $objdir/$soname-exp~
  1013. $CC $objdir/$soname-exp -Wl,--dll -nostartfiles -Wl,-e,__cygwin_dll_entry@12 -o $lib $objdir/$soname-ltdll.$objext $libobjs $deplibs $linkopts'
  1014. old_archive_from_new_cmds='$DLLTOOL --as=$AS --dllname $soname --def $objdir/$soname-def --output-lib $objdir/$libname.a'
  1015. ;;
  1016. netbsd*)
  1017. if $LD --help 2>&1 | egrep ': supported targets:.* elf' > /dev/null; then
  1018. archive_cmds='$CC -shared $libobjs $deplibs $linkopts ${wl}-soname $wl$soname -o $lib'
  1019. archive_expsym_cmds='$CC -shared $libobjs $deplibs $linkopts ${wl}-soname $wl$soname ${wl}-retain-symbols-file $wl$export_symbols -o $lib'
  1020. else
  1021. archive_cmds='$LD -Bshareable $libobjs $deplibs $linkopts -o $lib'
  1022. # can we support soname and/or expsyms with a.out? -oliva
  1023. fi
  1024. ;;
  1025. sunos4*)
  1026. archive_cmds='$LD -assert pure-text -Bshareable -o $lib $libobjs $deplibs $linkopts'
  1027. wlarc=
  1028. hardcode_direct=yes
  1029. hardcode_shlibpath_var=no
  1030. ;;
  1031. *)
  1032. if $LD --help 2>&1 | egrep ': supported targets:.* elf' > /dev/null; then
  1033. archive_cmds='$CC -shared $libobjs $deplibs $linkopts ${wl}-soname $wl$soname -o $lib'
  1034. archive_expsym_cmds='$CC -shared $libobjs $deplibs $linkopts ${wl}-soname $wl$soname ${wl}-retain-symbols-file $wl$export_symbols -o $lib'
  1035. else
  1036. ld_shlibs=no
  1037. fi
  1038. ;;
  1039. esac
  1040. if test "$ld_shlibs" = yes; then
  1041. runpath_var=LD_RUN_PATH
  1042. hardcode_libdir_flag_spec='${wl}--rpath ${wl}$libdir'
  1043. export_dynamic_flag_spec='${wl}--export-dynamic'
  1044. whole_archive_flag_spec="$wlarc"'--whole-archive$convenience '"$wlarc"'--no-whole-archive'
  1045. fi
  1046. else
  1047. # PORTME fill in a description of your system's linker (not GNU ld)
  1048. case "$host_os" in
  1049. aix3*)
  1050. allow_undefined_flag=unsupported
  1051. always_export_symbols=yes
  1052. archive_expsym_cmds='$LD -o $objdir/$soname $libobjs $deplibs $linkopts -bE:$export_symbols -T512 -H512 -bM:SRE~$AR cru $lib $objdir/$soname'
  1053. # Note: this linker hardcodes the directories in LIBPATH if there
  1054. # are no directories specified by -L.
  1055. hardcode_minus_L=yes
  1056. if test "$with_gcc" = yes && test -z "$link_static_flag"; then
  1057. # Neither direct hardcoding nor static linking is supported with a
  1058. # broken collect2.
  1059. hardcode_direct=unsupported
  1060. fi
  1061. ;;
  1062. aix4*)
  1063. hardcode_libdir_flag_spec='${wl}-b ${wl}nolibpath ${wl}-b ${wl}libpath:$libdir:/usr/lib:/lib'
  1064. hardcode_libdir_separator=':'
  1065. if test "$with_gcc" = yes; then
  1066. collect2name=`${CC} -print-prog-name=collect2`
  1067. if test -f "$collect2name" && \
  1068. strings "$collect2name" | grep resolve_lib_name >/dev/null
  1069. then
  1070. # We have reworked collect2
  1071. hardcode_direct=yes
  1072. else
  1073. # We have old collect2
  1074. hardcode_direct=unsupported
  1075. # It fails to find uninstalled libraries when the uninstalled
  1076. # path is not listed in the libpath. Setting hardcode_minus_L
  1077. # to unsupported forces relinking
  1078. hardcode_minus_L=yes
  1079. hardcode_libdir_flag_spec='-L$libdir'
  1080. hardcode_libdir_separator=
  1081. fi
  1082. shared_flag='-shared'
  1083. else
  1084. shared_flag='${wl}-bM:SRE'
  1085. hardcode_direct=yes
  1086. fi
  1087. allow_undefined_flag=' ${wl}-berok'
  1088. archive_cmds="\$CC $shared_flag"' -o $objdir/$soname $libobjs $deplibs $linkopts ${wl}-bexpall ${wl}-bnoentry${allow_undefined_flag}'
  1089. archive_expsym_cmds="\$CC $shared_flag"' -o $objdir/$soname $libobjs $deplibs $linkopts ${wl}-bE:$export_symbols ${wl}-bnoentry${allow_undefined_flag}'
  1090. case "$host_os" in aix4.[01]|aix4.[01].*)
  1091. # According to Greg Wooledge, -bexpall is only supported from AIX 4.2 on
  1092. always_export_symbols=yes ;;
  1093. esac
  1094. ;;
  1095. amigaos*)
  1096. archive_cmds='$rm $objdir/a2ixlibrary.data~$echo "#define NAME $libname" > $objdir/a2ixlibrary.data~$echo "#define LIBRARY_ID 1" >> $objdir/a2ixlibrary.data~$echo "#define VERSION $major" >> $objdir/a2ixlibrary.data~$echo "#define REVISION $revision" >> $objdir/a2ixlibrary.data~$AR cru $lib $libobjs~$RANLIB $lib~(cd $objdir && a2ixlibrary -32)'
  1097. hardcode_libdir_flag_spec='-L$libdir'
  1098. hardcode_minus_L=yes
  1099. # see comment about different semantics on the GNU ld section
  1100. ld_shlibs=no
  1101. ;;
  1102. cygwin* | mingw*)
  1103. # When not using gcc, we currently assume that we are using
  1104. # Microsoft Visual C++.
  1105. # hardcode_libdir_flag_spec is actually meaningless, as there is
  1106. # no search path for DLLs.
  1107. hardcode_libdir_flag_spec=' '
  1108. allow_undefined_flag=unsupported
  1109. # Tell ltmain to make .lib files, not .a files.
  1110. libext=lib
  1111. # FIXME: Setting linknames here is a bad hack.
  1112. archive_cmds='$CC -o $lib $libobjs $linkopts `echo "$deplibs" | sed -e '\''s/ -lc$//'\''` -link -dll~linknames='
  1113. # The linker will automatically build a .lib file if we build a DLL.
  1114. old_archive_from_new_cmds='true'
  1115. # FIXME: Should let the user specify the lib program.
  1116. old_archive_cmds='lib /OUT:$oldlib$oldobjs'
  1117. fix_srcfile_path='`cygpath -w $srcfile`'
  1118. ;;
  1119. freebsd1*)
  1120. ld_shlibs=no
  1121. ;;
  1122. # FreeBSD 2.2.[012] allows us to include c++rt0.o to get C++ constructor
  1123. # support. Future versions do this automatically, but an explicit c++rt0.o
  1124. # does not break anything, and helps significantly (at the cost of a little
  1125. # extra space).
  1126. freebsd2.2*)
  1127. archive_cmds='$LD -Bshareable -o $lib $libobjs $deplibs $linkopts /usr/lib/c++rt0.o'
  1128. hardcode_libdir_flag_spec='-R$libdir'
  1129. hardcode_direct=yes
  1130. hardcode_shlibpath_var=no
  1131. ;;
  1132. # Unfortunately, older versions of FreeBSD 2 do not have this feature.
  1133. freebsd2*)
  1134. archive_cmds='$LD -Bshareable -o $lib $libobjs $deplibs $linkopts'
  1135. hardcode_direct=yes
  1136. hardcode_minus_L=yes
  1137. hardcode_shlibpath_var=no
  1138. ;;
  1139. # FreeBSD 3 and greater uses gcc -shared to do shared libraries.
  1140. freebsd*)
  1141. archive_cmds='$CC -shared -o $lib $libobjs $deplibs $linkopts'
  1142. hardcode_libdir_flag_spec='-R$libdir'
  1143. hardcode_direct=yes
  1144. hardcode_shlibpath_var=no
  1145. ;;
  1146. hpux9* | hpux10* | hpux11*)
  1147. case "$host_os" in
  1148. hpux9*) archive_cmds='$rm $objdir/$soname~$LD -b +b $install_libdir -o $objdir/$soname $libobjs $deplibs $linkopts~test $objdir/$soname = $lib || mv $objdir/$soname $lib' ;;
  1149. *) archive_cmds='$LD -b +h $soname +b $install_libdir -o $lib $libobjs $deplibs $linkopts' ;;
  1150. esac
  1151. hardcode_libdir_flag_spec='${wl}+b ${wl}$libdir'
  1152. hardcode_libdir_separator=:
  1153. hardcode_direct=yes
  1154. hardcode_minus_L=yes # Not in the search PATH, but as the default
  1155. # location of the library.
  1156. export_dynamic_flag_spec='${wl}-E'
  1157. ;;
  1158. irix5* | irix6*)
  1159. if test "$with_gcc" = yes; then
  1160. archive_cmds='$CC -shared $libobjs $deplibs $linkopts ${wl}-soname ${wl}$soname `test -n "$verstring" && echo ${wl}-set_version ${wl}$verstring` ${wl}-update_registry ${wl}${objdir}/so_locations -o $lib'
  1161. else
  1162. archive_cmds='$LD -shared $libobjs $deplibs $linkopts -soname $soname `test -n "$verstring" && echo -set_version $verstring` -update_registry ${objdir}/so_locations -o $lib'
  1163. fi
  1164. hardcode_libdir_flag_spec='${wl}-rpath ${wl}$libdir'
  1165. hardcode_libdir_separator=:
  1166. ;;
  1167. netbsd*)
  1168. if echo __ELF__ | $CC -E - | grep __ELF__ >/dev/null; then
  1169. archive_cmds='$LD -Bshareable -o $lib $libobjs $deplibs $linkopts' # a.out
  1170. else
  1171. archive_cmds='$LD -shared -o $lib $libobjs $deplibs $linkopts' # ELF
  1172. fi
  1173. hardcode_libdir_flag_spec='${wl}-R$libdir'
  1174. hardcode_direct=yes
  1175. hardcode_shlibpath_var=no
  1176. ;;
  1177. openbsd*)
  1178. archive_cmds='$LD -Bshareable -o $lib $libobjs $deplibs $linkopts'
  1179. hardcode_libdir_flag_spec='-R$libdir'
  1180. hardcode_direct=yes
  1181. hardcode_shlibpath_var=no
  1182. ;;
  1183. os2*)
  1184. hardcode_libdir_flag_spec='-L$libdir'
  1185. hardcode_minus_L=yes
  1186. allow_undefined_flag=unsupported
  1187. archive_cmds='$echo "LIBRARY $libname INITINSTANCE" > $objdir/$libname.def~$echo "DESCRIPTION \"$libname\"" >> $objdir/$libname.def~$echo DATA >> $objdir/$libname.def~$echo " SINGLE NONSHARED" >> $objdir/$libname.def~$echo EXPORTS >> $objdir/$libname.def~emxexp $libobjs >> $objdir/$libname.def~$CC -Zdll -Zcrtdll -o $lib $libobjs $deplibs $linkopts $objdir/$libname.def'
  1188. old_archive_from_new_cmds='emximp -o $objdir/$libname.a $objdir/$libname.def'
  1189. ;;
  1190. osf3* | osf4*)
  1191. if test "$with_gcc" = yes; then
  1192. allow_undefined_flag=' ${wl}-expect_unresolved ${wl}\*'
  1193. archive_cmds='$CC -shared${allow_undefined_flag} $libobjs $deplibs $linkopts ${wl}-soname ${wl}$soname `test -n "$verstring" && echo ${wl}-set_version ${wl}$verstring` ${wl}-update_registry ${wl}${objdir}/so_locations -o $lib'
  1194. else
  1195. allow_undefined_flag=' -expect_unresolved \*'
  1196. archive_cmds='$LD -shared${allow_undefined_flag} $libobjs $deplibs $linkopts -soname $soname `test -n "$verstring" && echo -set_version $verstring` -update_registry ${objdir}/so_locations -o $lib'
  1197. fi
  1198. hardcode_libdir_flag_spec='${wl}-rpath ${wl}$libdir'
  1199. hardcode_libdir_separator=:
  1200. ;;
  1201. sco3.2v5*)
  1202. archive_cmds='$LD -G -h $soname -o $lib $libobjs $deplibs $linkopts'
  1203. hardcode_shlibpath_var=no
  1204. runpath_var=LD_RUN_PATH
  1205. hardcode_runpath_var=yes
  1206. ;;
  1207. solaris*)
  1208. no_undefined_flag=' -z text'
  1209. # $CC -shared without GNU ld will not create a library from C++
  1210. # object files and a static libstdc++, better avoid it by now
  1211. archive_cmds='$LD -G${allow_undefined_flag} -h $soname -o $lib $libobjs $deplibs $linkopts'
  1212. archive_expsym_cmds='$echo "{ global:" > $lib.exp~cat $export_symbols | sed -e "s/\(.*\)/\1;/" >> $lib.exp~$echo "local: *; };" >> $lib.exp~
  1213. $LD -G${allow_undefined_flag} -M $lib.exp -h $soname -o $lib $libobjs $deplibs $linkopts~$rm $lib.exp'
  1214. hardcode_libdir_flag_spec='-R$libdir'
  1215. hardcode_shlibpath_var=no
  1216. case "$host_os" in
  1217. solaris2.[0-5] | solaris2.[0-5].*) ;;
  1218. *) # Supported since Solaris 2.6 (maybe 2.5.1?)
  1219. whole_archive_flag_spec='${wl}-z ${wl}allextract$convenience ${wl}-z ${wl}defaultextract' ;;
  1220. esac
  1221. ;;
  1222. sunos4*)
  1223. archive_cmds='$LD -assert pure-text -Bstatic -o $lib $libobjs $deplibs $linkopts'
  1224. hardcode_libdir_flag_spec='-L$libdir'
  1225. hardcode_direct=yes
  1226. hardcode_minus_L=yes
  1227. hardcode_shlibpath_var=no
  1228. ;;
  1229. sysv4)
  1230. archive_cmds='$LD -G -h $soname -o $lib $libobjs $deplibs $linkopts'
  1231. runpath_var='LD_RUN_PATH'
  1232. hardcode_shlibpath_var=no
  1233. hardcode_direct=no #Motorola manual says yes, but my tests say they lie
  1234. ;;
  1235. sysv4.3*)
  1236. archive_cmds='$LD -G -h $soname -o $lib $libobjs $deplibs $linkopts'
  1237. hardcode_shlibpath_var=no
  1238. export_dynamic_flag_spec='-Bexport'
  1239. ;;
  1240. uts4*)
  1241. archive_cmds='$LD -G -h $soname -o $lib $libobjs $deplibs $linkopts'
  1242. hardcode_libdir_flag_spec='-L$libdir'
  1243. hardcode_shlibpath_var=no
  1244. ;;
  1245. dgux*)
  1246. archive_cmds='$LD -G -h $soname -o $lib $libobjs $deplibs $linkopts'
  1247. hardcode_libdir_flag_spec='-L$libdir'
  1248. hardcode_shlibpath_var=no
  1249. ;;
  1250. *)
  1251. ld_shlibs=no
  1252. ;;
  1253. esac
  1254. fi
  1255. echo "$ac_t$ld_shlibs" 1>&6
  1256. test "$ld_shlibs" = no && can_build_shared=no
  1257. if test -z "$NM"; then
  1258. echo $ac_n "checking for BSD-compatible nm... $ac_c" 1>&6
  1259. case "$NM" in
  1260. [\\/]* | [A-Za-z]:[\\/]*) ;; # Let the user override the test with a path.
  1261. *)
  1262. IFS="${IFS= }"; ac_save_ifs="$IFS"; IFS="${IFS}${PATH_SEPARATOR}"
  1263. for ac_dir in $PATH /usr/ucb /usr/ccs/bin /bin; do
  1264. test -z "$ac_dir" && ac_dir=.
  1265. if test -f $ac_dir/nm || test -f $ac_dir/nm$ac_exeext; then
  1266. # Check to see if the nm accepts a BSD-compat flag.
  1267. # Adding the `sed 1q' prevents false positives on HP-UX, which says:
  1268. # nm: unknown option "B" ignored
  1269. if ($ac_dir/nm -B /dev/null 2>&1 | sed '1q'; exit 0) | egrep /dev/null >/dev/null; then
  1270. NM="$ac_dir/nm -B"
  1271. break
  1272. elif ($ac_dir/nm -p /dev/null 2>&1 | sed '1q'; exit 0) | egrep /dev/null >/dev/null; then
  1273. NM="$ac_dir/nm -p"
  1274. break
  1275. else
  1276. NM=${NM="$ac_dir/nm"} # keep the first match, but
  1277. continue # so that we can try to find one that supports BSD flags
  1278. fi
  1279. fi
  1280. done
  1281. IFS="$ac_save_ifs"
  1282. test -z "$NM" && NM=nm
  1283. ;;
  1284. esac
  1285. echo "$ac_t$NM" 1>&6
  1286. fi
  1287. # Check for command to grab the raw symbol name followed by C symbol from nm.
  1288. echo $ac_n "checking command to parse $NM output... $ac_c" 1>&6
  1289. # These are sane defaults that work on at least a few old systems.
  1290. # [They come from Ultrix. What could be older than Ultrix?!! ;)]
  1291. # Character class describing NM global symbol codes.
  1292. symcode='[BCDEGRST]'
  1293. # Regexp to match symbols that can be accessed directly from C.
  1294. sympat='\([_A-Za-z][_A-Za-z0-9]*\)'
  1295. # Transform the above into a raw symbol and a C symbol.
  1296. symxfrm='\1 \2\3 \3'
  1297. # Transform an extracted symbol line into a proper C declaration
  1298. global_symbol_to_cdecl="sed -n -e 's/^. .* \(.*\)$/extern char \1;/p'"
  1299. # Define system-specific variables.
  1300. case "$host_os" in
  1301. aix*)
  1302. symcode='[BCDT]'
  1303. ;;
  1304. cygwin* | mingw*)
  1305. symcode='[ABCDGISTW]'
  1306. ;;
  1307. hpux*) # Its linker distinguishes data from code symbols
  1308. global_symbol_to_cdecl="sed -n -e 's/^T .* \(.*\)$/extern char \1();/p' -e 's/^. .* \(.*\)$/extern char \1;/p'"
  1309. ;;
  1310. irix*)
  1311. symcode='[BCDEGRST]'
  1312. ;;
  1313. solaris*)
  1314. symcode='[BDT]'
  1315. ;;
  1316. sysv4)
  1317. symcode='[DFNSTU]'
  1318. ;;
  1319. esac
  1320. # If we're using GNU nm, then use its standard symbol codes.
  1321. if $NM -V 2>&1 | egrep '(GNU|with BFD)' > /dev/null; then
  1322. symcode='[ABCDGISTW]'
  1323. fi
  1324. # Try without a prefix undercore, then with it.
  1325. for ac_symprfx in "" "_"; do
  1326. # Write the raw and C identifiers.
  1327. global_symbol_pipe="sed -n -e 's/^.*[ ]\($symcode\)[ ][ ]*\($ac_symprfx\)$sympat$/$symxfrm/p'"
  1328. # Check to see that the pipe works correctly.
  1329. pipe_works=no
  1330. $rm conftest*
  1331. cat > conftest.c <<EOF
  1332. #ifdef __cplusplus
  1333. extern "C" {
  1334. #endif
  1335. char nm_test_var;
  1336. void nm_test_func(){}
  1337. #ifdef __cplusplus
  1338. }
  1339. #endif
  1340. main(){nm_test_var='a';nm_test_func();return(0);}
  1341. EOF
  1342. echo "$progname:1507: checking if global_symbol_pipe works" >&5
  1343. if { (eval echo $progname:1508: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; } && test -s conftest.$objext; then
  1344. # Now try to grab the symbols.
  1345. nlist=conftest.nm
  1346. if { echo "$progname:1511: eval \"$NM conftest.$objext | $global_symbol_pipe > $nlist\"" >&5; eval "$NM conftest.$objext | $global_symbol_pipe > $nlist 2>&5"; } && test -s "$nlist"; then
  1347. # Try sorting and uniquifying the output.
  1348. if sort "$nlist" | uniq > "$nlist"T; then
  1349. mv -f "$nlist"T "$nlist"
  1350. else
  1351. rm -f "$nlist"T
  1352. fi
  1353. # Make sure that we snagged all the symbols we need.
  1354. if egrep ' nm_test_var$' "$nlist" >/dev/null; then
  1355. if egrep ' nm_test_func$' "$nlist" >/dev/null; then
  1356. cat <<EOF > conftest.c
  1357. #ifdef __cplusplus
  1358. extern "C" {
  1359. #endif
  1360. EOF
  1361. # Now generate the symbol file.
  1362. eval "$global_symbol_to_cdecl"' < "$nlist" >> conftest.c'
  1363. cat <<EOF >> conftest.c
  1364. #if defined (__STDC__) && __STDC__
  1365. # define lt_ptr_t void *
  1366. #else
  1367. # define lt_ptr_t char *
  1368. # define const
  1369. #endif
  1370. /* The mapping between symbol names and symbols. */
  1371. const struct {
  1372. const char *name;
  1373. lt_ptr_t address;
  1374. }
  1375. lt_preloaded_symbols[] =
  1376. {
  1377. EOF
  1378. sed 's/^. \(.*\) \(.*\)$/ {"\2", (lt_ptr_t) \&\2},/' < "$nlist" >> conftest.c
  1379. cat <<\EOF >> conftest.c
  1380. {0, (lt_ptr_t) 0}
  1381. };
  1382. #ifdef __cplusplus
  1383. }
  1384. #endif
  1385. EOF
  1386. # Now try linking the two files.
  1387. mv conftest.$objext conftstm.$objext
  1388. save_LIBS="$LIBS"
  1389. save_CFLAGS="$CFLAGS"
  1390. LIBS="conftstm.$objext"
  1391. CFLAGS="$CFLAGS$no_builtin_flag"
  1392. if { (eval echo $progname:1563: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest; then
  1393. pipe_works=yes
  1394. else
  1395. echo "$progname: failed program was:" >&5
  1396. cat conftest.c >&5
  1397. fi
  1398. LIBS="$save_L…

Large files files are truncated, but you can click here to view the full file