PageRenderTime 54ms CodeModel.GetById 22ms RepoModel.GetById 0ms app.codeStats 0ms

/tags/sdcc-290-pre1/binutils-avr/ltconfig

#
Shell | 2048 lines | 1587 code | 188 blank | 273 comment | 198 complexity | b33ab01beba17a9741a4fb7ce45703c9 MD5 | raw file
Possible License(s): GPL-2.0, LGPL-2.0, LGPL-2.1, GPL-3.0

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.2
  156. TIMESTAMP=" (1.385.2.150 1999/05/26 00:28:32)"
  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. sysv4*MP*)
  572. if test -d /usr/nec; then
  573. pic_flag=-Kconform_pic
  574. fi
  575. ;;
  576. *)
  577. pic_flag='-fPIC'
  578. ;;
  579. esac
  580. else
  581. # PORTME Check for PIC flags for the system compiler.
  582. case "$host_os" in
  583. aix3* | aix4*)
  584. # All AIX code is PIC.
  585. link_static_flag='-bnso -bI:/lib/syscalls.exp'
  586. ;;
  587. hpux9* | hpux10* | hpux11*)
  588. # Is there a better link_static_flag that works with the bundled CC?
  589. wl='-Wl,'
  590. link_static_flag="${wl}-a ${wl}archive"
  591. pic_flag='+Z'
  592. ;;
  593. irix5* | irix6*)
  594. wl='-Wl,'
  595. link_static_flag='-non_shared'
  596. # PIC (with -KPIC) is the default.
  597. ;;
  598. cygwin* | mingw* | os2*)
  599. # We can build DLLs from non-PIC.
  600. ;;
  601. osf3* | osf4*)
  602. # All OSF/1 code is PIC.
  603. wl='-Wl,'
  604. link_static_flag='-non_shared'
  605. ;;
  606. sco3.2v5*)
  607. pic_flag='-Kpic'
  608. link_static_flag='-dn'
  609. special_shlib_compile_flags='-belf'
  610. ;;
  611. solaris*)
  612. pic_flag='-KPIC'
  613. link_static_flag='-Bstatic'
  614. wl='-Wl,'
  615. ;;
  616. sunos4*)
  617. pic_flag='-PIC'
  618. link_static_flag='-Bstatic'
  619. wl='-Qoption ld '
  620. ;;
  621. sysv4 | sysv4.2uw2* | sysv4.3* | sysv5*)
  622. pic_flag='-KPIC'
  623. link_static_flag='-Bstatic'
  624. wl='-Wl,'
  625. ;;
  626. uts4*)
  627. pic_flag='-pic'
  628. link_static_flag='-Bstatic'
  629. ;;
  630. sysv4*MP*)
  631. if test -d /usr/nec ;then
  632. pic_flag='-Kconform_pic'
  633. link_static_flag='-Bstatic'
  634. fi
  635. ;;
  636. *)
  637. can_build_shared=no
  638. ;;
  639. esac
  640. fi
  641. if test -n "$pic_flag"; then
  642. echo "$ac_t$pic_flag" 1>&6
  643. # Check to make sure the pic_flag actually works.
  644. echo $ac_n "checking if $compiler PIC flag $pic_flag works... $ac_c" 1>&6
  645. $rm conftest*
  646. echo "int some_variable = 0;" > conftest.c
  647. save_CFLAGS="$CFLAGS"
  648. CFLAGS="$CFLAGS $pic_flag -DPIC"
  649. echo "$progname:742: checking if $compiler PIC flag $pic_flag works" >&5
  650. if { (eval echo $progname:743: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>conftest.err; } && test -s conftest.$objext; then
  651. # Append any warnings to the config.log.
  652. cat conftest.err 1>&5
  653. case "$host_os" in
  654. hpux9* | hpux10* | hpux11*)
  655. # On HP-UX, both CC and GCC only warn that PIC is supported... then they
  656. # create non-PIC objects. So, if there were any warnings, we assume that
  657. # PIC is not supported.
  658. if test -s conftest.err; then
  659. echo "$ac_t"no 1>&6
  660. can_build_shared=no
  661. pic_flag=
  662. else
  663. echo "$ac_t"yes 1>&6
  664. pic_flag=" $pic_flag"
  665. fi
  666. ;;
  667. *)
  668. echo "$ac_t"yes 1>&6
  669. pic_flag=" $pic_flag"
  670. ;;
  671. esac
  672. else
  673. # Append any errors to the config.log.
  674. cat conftest.err 1>&5
  675. can_build_shared=no
  676. pic_flag=
  677. echo "$ac_t"no 1>&6
  678. fi
  679. CFLAGS="$save_CFLAGS"
  680. $rm conftest*
  681. else
  682. echo "$ac_t"none 1>&6
  683. fi
  684. # Check to see if options -o and -c are simultaneously supported by compiler
  685. echo $ac_n "checking if $compiler supports -c -o file.o... $ac_c" 1>&6
  686. $rm -r conftest 2>/dev/null
  687. mkdir conftest
  688. cd conftest
  689. $rm conftest*
  690. echo "int some_variable = 0;" > conftest.c
  691. mkdir out
  692. # According to Tom Tromey, Ian Lance Taylor reported there are C compilers
  693. # that will create temporary files in the current directory regardless of
  694. # the output directory. Thus, making CWD read-only will cause this test
  695. # to fail, enabling locking or at least warning the user not to do parallel
  696. # builds.
  697. chmod -w .
  698. save_CFLAGS="$CFLAGS"
  699. CFLAGS="$CFLAGS -o out/conftest2.o"
  700. echo "$progname:795: checking if $compiler supports -c -o file.o" >&5
  701. if { (eval echo $progname:796: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>out/conftest.err; } && test -s out/conftest2.o; then
  702. # The compiler can only warn and ignore the option if not recognized
  703. # So say no if there are warnings
  704. if test -s out/conftest.err; then
  705. echo "$ac_t"no 1>&6
  706. compiler_c_o=no
  707. else
  708. echo "$ac_t"yes 1>&6
  709. compiler_c_o=yes
  710. fi
  711. else
  712. # Append any errors to the config.log.
  713. cat out/conftest.err 1>&5
  714. compiler_c_o=no
  715. echo "$ac_t"no 1>&6
  716. fi
  717. CFLAGS="$save_CFLAGS"
  718. chmod u+w .
  719. $rm conftest* out/*
  720. rmdir out
  721. cd ..
  722. rmdir conftest
  723. $rm -r conftest 2>/dev/null
  724. if test x"$compiler_c_o" = x"yes"; then
  725. # Check to see if we can write to a .lo
  726. echo $ac_n "checking if $compiler supports -c -o file.lo... $ac_c" 1>&6
  727. $rm conftest*
  728. echo "int some_variable = 0;" > conftest.c
  729. save_CFLAGS="$CFLAGS"
  730. CFLAGS="$CFLAGS -c -o conftest.lo"
  731. echo "$progname:828: checking if $compiler supports -c -o file.lo" >&5
  732. if { (eval echo $progname:829: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>conftest.err; } && test -s conftest.lo; then
  733. # The compiler can only warn and ignore the option if not recognized
  734. # So say no if there are warnings
  735. if test -s conftest.err; then
  736. echo "$ac_t"no 1>&6
  737. compiler_o_lo=no
  738. else
  739. echo "$ac_t"yes 1>&6
  740. compiler_o_lo=yes
  741. fi
  742. else
  743. # Append any errors to the config.log.
  744. cat conftest.err 1>&5
  745. compiler_o_lo=no
  746. echo "$ac_t"no 1>&6
  747. fi
  748. CFLAGS="$save_CFLAGS"
  749. $rm conftest*
  750. else
  751. compiler_o_lo=no
  752. fi
  753. # Check to see if we can do hard links to lock some files if needed
  754. hard_links="nottested"
  755. if test "$compiler_c_o" = no && test "$need_locks" != no; then
  756. # do not overwrite the value of need_locks provided by the user
  757. echo $ac_n "checking if we can lock with hard links... $ac_c" 1>&6
  758. hard_links=yes
  759. $rm conftest*
  760. ln conftest.a conftest.b 2>/dev/null && hard_links=no
  761. touch conftest.a
  762. ln conftest.a conftest.b 2>&5 || hard_links=no
  763. ln conftest.a conftest.b 2>/dev/null && hard_links=no
  764. echo "$ac_t$hard_links" 1>&6
  765. $rm conftest*
  766. if test "$hard_links" = no; then
  767. echo "*** WARNING: \`$CC' does not support \`-c -o', so \`make -j' may be unsafe" >&2
  768. need_locks=warn
  769. fi
  770. else
  771. need_locks=no
  772. fi
  773. if test "$with_gcc" = yes; then
  774. # Check to see if options -fno-rtti -fno-exceptions are supported by compiler
  775. echo $ac_n "checking if $compiler supports -fno-rtti -fno-exceptions ... $ac_c" 1>&6
  776. $rm conftest*
  777. echo "int some_variable = 0;" > conftest.c
  778. save_CFLAGS="$CFLAGS"
  779. CFLAGS="$CFLAGS -fno-rtti -fno-exceptions -c conftest.c"
  780. echo "$progname:880: checking if $compiler supports -fno-rtti -fno-exceptions" >&5
  781. if { (eval echo $progname:881: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>conftest.err; } && test -s conftest.o; then
  782. # The compiler can only warn and ignore the option if not recognized
  783. # So say no if there are warnings
  784. if test -s conftest.err; then
  785. echo "$ac_t"no 1>&6
  786. compiler_rtti_exceptions=no
  787. else
  788. echo "$ac_t"yes 1>&6
  789. compiler_rtti_exceptions=yes
  790. fi
  791. else
  792. # Append any errors to the config.log.
  793. cat conftest.err 1>&5
  794. compiler_rtti_exceptions=no
  795. echo "$ac_t"no 1>&6
  796. fi
  797. CFLAGS="$save_CFLAGS"
  798. $rm conftest*
  799. if test "$compiler_rtti_exceptions" = "yes"; then
  800. no_builtin_flag=' -fno-builtin -fno-rtti -fno-exceptions'
  801. else
  802. no_builtin_flag=' -fno-builtin'
  803. fi
  804. fi
  805. # Check for any special shared library compilation flags.
  806. if test -n "$special_shlib_compile_flags"; then
  807. echo "$progname: warning: \`$CC' requires \`$special_shlib_compile_flags' to build shared libraries" 1>&2
  808. if echo "$old_CC $old_CFLAGS " | egrep -e "[ ]$special_shlib_compile_flags[ ]" >/dev/null; then :
  809. else
  810. echo "$progname: add \`$special_shlib_compile_flags' to the CC or CFLAGS env variable and reconfigure" 1>&2
  811. can_build_shared=no
  812. fi
  813. fi
  814. echo $ac_n "checking if $compiler static flag $link_static_flag works... $ac_c" 1>&6
  815. $rm conftest*
  816. echo 'main(){return(0);}' > conftest.c
  817. save_LDFLAGS="$LDFLAGS"
  818. LDFLAGS="$LDFLAGS $link_static_flag"
  819. echo "$progname:924: checking if $compiler static flag $link_static_flag works" >&5
  820. if { (eval echo $progname:925: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest; then
  821. echo "$ac_t$link_static_flag" 1>&6
  822. else
  823. echo "$ac_t"none 1>&6
  824. link_static_flag=
  825. fi
  826. LDFLAGS="$save_LDFLAGS"
  827. $rm conftest*
  828. if test -z "$LN_S"; then
  829. # Check to see if we can use ln -s, or we need hard links.
  830. echo $ac_n "checking whether ln -s works... $ac_c" 1>&6
  831. $rm conftest.dat
  832. if ln -s X conftest.dat 2>/dev/null; then
  833. $rm conftest.dat
  834. LN_S="ln -s"
  835. else
  836. LN_S=ln
  837. fi
  838. if test "$LN_S" = "ln -s"; then
  839. echo "$ac_t"yes 1>&6
  840. else
  841. echo "$ac_t"no 1>&6
  842. fi
  843. fi
  844. # Make sure LD is an absolute path.
  845. if test -z "$LD"; then
  846. ac_prog=ld
  847. if test "$with_gcc" = yes; then
  848. # Check if gcc -print-prog-name=ld gives a path.
  849. echo $ac_n "checking for ld used by GCC... $ac_c" 1>&6
  850. echo "$progname:957: checking for ld used by GCC" >&5
  851. ac_prog=`($CC -print-prog-name=ld) 2>&5`
  852. case "$ac_prog" in
  853. # Accept absolute paths.
  854. [\\/]* | [A-Za-z]:[\\/]*)
  855. re_direlt='/[^/][^/]*/\.\./'
  856. # Canonicalize the path of ld
  857. ac_prog=`echo $ac_prog| sed 's%\\\\%/%g'`
  858. while echo $ac_prog | grep "$re_direlt" > /dev/null 2>&1; do
  859. ac_prog=`echo $ac_prog| sed "s%$re_direlt%/%"`
  860. done
  861. test -z "$LD" && LD="$ac_prog"
  862. ;;
  863. "")
  864. # If it fails, then pretend we are not using GCC.
  865. ac_prog=ld
  866. ;;
  867. *)
  868. # If it is relative, then search for the first ld in PATH.
  869. with_gnu_ld=unknown
  870. ;;
  871. esac
  872. elif test "$with_gnu_ld" = yes; then
  873. echo $ac_n "checking for GNU ld... $ac_c" 1>&6
  874. echo "$progname:981: checking for GNU ld" >&5
  875. else
  876. echo $ac_n "checking for non-GNU ld""... $ac_c" 1>&6
  877. echo "$progname:984: checking for non-GNU ld" >&5
  878. fi
  879. if test -z "$LD"; then
  880. IFS="${IFS= }"; ac_save_ifs="$IFS"; IFS="${IFS}${PATH_SEPARATOR}"
  881. for ac_dir in $PATH; do
  882. test -z "$ac_dir" && ac_dir=.
  883. if test -f "$ac_dir/$ac_prog" || test -f "$ac_dir/$ac_prog$ac_exeext"; then
  884. LD="$ac_dir/$ac_prog"
  885. # Check to see if the program is GNU ld. I'd rather use --version,
  886. # but apparently some GNU ld's only accept -v.
  887. # Break only if it was the GNU/non-GNU ld that we prefer.
  888. if "$LD" -v 2>&1 < /dev/null | egrep '(GNU|with BFD)' > /dev/null; then
  889. test "$with_gnu_ld" != no && break
  890. else
  891. test "$with_gnu_ld" != yes && break
  892. fi
  893. fi
  894. done
  895. IFS="$ac_save_ifs"
  896. fi
  897. if test -n "$LD"; then
  898. echo "$ac_t$LD" 1>&6
  899. else
  900. echo "$ac_t"no 1>&6
  901. fi
  902. if test -z "$LD"; then
  903. echo "$progname: error: no acceptable ld found in \$PATH" 1>&2
  904. exit 1
  905. fi
  906. fi
  907. # Check to see if it really is or is not GNU ld.
  908. echo $ac_n "checking if the linker ($LD) is GNU ld... $ac_c" 1>&6
  909. # I'd rather use --version here, but apparently some GNU ld's only accept -v.
  910. if $LD -v 2>&1 </dev/null | egrep '(GNU|with BFD)' 1>&5; then
  911. with_gnu_ld=yes
  912. else
  913. with_gnu_ld=no
  914. fi
  915. echo "$ac_t$with_gnu_ld" 1>&6
  916. # See if the linker supports building shared libraries.
  917. echo $ac_n "checking whether the linker ($LD) supports shared libraries... $ac_c" 1>&6
  918. allow_undefined_flag=
  919. no_undefined_flag=
  920. need_lib_prefix=unknown
  921. need_version=unknown
  922. # when you set need_version to no, make sure it does not cause -set_version
  923. # flags to be left without arguments
  924. archive_cmds=
  925. archive_expsym_cmds=
  926. old_archive_from_new_cmds=
  927. export_dynamic_flag_spec=
  928. whole_archive_flag_spec=
  929. thread_safe_flag_spec=
  930. hardcode_libdir_flag_spec=
  931. hardcode_libdir_separator=
  932. hardcode_direct=no
  933. hardcode_minus_L=no
  934. hardcode_shlibpath_var=unsupported
  935. runpath_var=
  936. always_export_symbols=no
  937. export_symbols_cmds='$NM $libobjs | $global_symbol_pipe | sed '\''s/.* //'\'' | sort | uniq > $export_symbols'
  938. # include_expsyms should be a list of space-separated symbols to be *always*
  939. # included in the symbol list
  940. include_expsyms=
  941. # exclude_expsyms can be an egrep regular expression of symbols to exclude
  942. # it will be wrapped by ` (' and `)$', so one must not match beginning or
  943. # end of line. Example: `a|bc|.*d.*' will exclude the symbols `a' and `bc',
  944. # as well as any symbol that contains `d'.
  945. exclude_expsyms="_GLOBAL_OFFSET_TABLE_"
  946. # Although _GLOBAL_OFFSET_TABLE_ is a valid symbol C name, most a.out
  947. # platforms (ab)use it in PIC code, but their linkers get confused if
  948. # the symbol is explicitly referenced. Since portable code cannot
  949. # rely on this symbol name, it's probably fine to never include it in
  950. # preloaded symbol tables.
  951. case "$host_os" in
  952. cygwin* | mingw*)
  953. # FIXME: the MSVC++ port hasn't been tested in a loooong time
  954. # When not using gcc, we currently assume that we are using
  955. # Microsoft Visual C++.
  956. if test "$with_gcc" != yes; then
  957. with_gnu_ld=no
  958. fi
  959. ;;
  960. esac
  961. ld_shlibs=yes
  962. if test "$with_gnu_ld" = yes; then
  963. # If archive_cmds runs LD, not CC, wlarc should be empty
  964. wlarc='${wl}'
  965. # See if GNU ld supports shared libraries.
  966. case "$host_os" in
  967. aix3* | aix4*)
  968. # On AIX, the GNU linker is very broken
  969. ld_shlibs=no
  970. cat <<EOF 1>&2
  971. *** Warning: the GNU linker, at least up to release 2.9.1, is reported
  972. *** to be unable to reliably create shared libraries on AIX.
  973. *** Therefore, libtool is disabling shared libraries support. If you
  974. *** really care for shared libraries, you may want to modify your PATH
  975. *** so that a non-GNU linker is found, and then restart.
  976. EOF
  977. ;;
  978. amigaos*)
  979. 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)'
  980. hardcode_libdir_flag_spec='-L$libdir'
  981. hardcode_minus_L=yes
  982. # Samuel A. Falvo II <kc5tja@dolphin.openprojects.net> reports
  983. # that the semantics of dynamic libraries on AmigaOS, at least up
  984. # to version 4, is to share data among multiple programs linked
  985. # with the same dynamic library. Since this doesn't match the
  986. # behavior of shared libraries on other platforms, we can use
  987. # them.
  988. ld_shlibs=no
  989. ;;
  990. beos*)
  991. $LD --help 2>&1 | egrep ': supported targets:.* elf' > /dev/null
  992. if test $? != 0; then
  993. $LD -V 2>&1 | egrep elf > /dev/null
  994. fi
  995. if test $? = 0; then
  996. allow_undefined_flag=unsupported
  997. # Joseph Beckenbach <jrb3@best.com> says some releases of gcc
  998. # support --undefined. This deserves some investigation. FIXME
  999. archive_cmds='$CC -nostart $libobjs $deplibs $linkopts ${wl}-soname $wl$soname -o $lib'
  1000. else
  1001. ld_shlibs=no
  1002. fi
  1003. ;;
  1004. cygwin* | mingw*)
  1005. # hardcode_libdir_flag_spec is actually meaningless, as there is
  1006. # no search path for DLLs.
  1007. hardcode_libdir_flag_spec='-L$libdir'
  1008. allow_undefined_flag=unsupported
  1009. always_export_symbols=yes
  1010. # Extract the symbol export list from an `--export-all' def file,
  1011. # then regenerate the def file from the symbol export list, so that
  1012. # the compiled dll only exports the symbol export list.
  1013. export_symbols_cmds='rm -f $objdir/$soname-ltdll.c~
  1014. sed -e "/^# \/\* ltdll\.c starts here \*\//,/^# \/\* ltdll.c ends here \*\// { s/^# //; p; }" -e d < $0 > $objdir/$soname-ltdll.c~
  1015. (cd $objdir && $CC -c $soname-ltdll.c)~
  1016. $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~
  1017. sed -e "1,/EXPORTS/d" -e "s/ @ [0-9]* ; *//" < $objdir/$soname-def > $export_symbols'
  1018. archive_expsym_cmds='echo EXPORTS > $objdir/$soname-def~
  1019. _lt_hint=1;
  1020. for symbol in `cat $export_symbols`; do
  1021. echo " \$symbol @ \$_lt_hint ; " >> $objdir/$soname-def;
  1022. _lt_hint=`expr 1 + \$_lt_hint`;
  1023. done~
  1024. $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~
  1025. $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~
  1026. $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~
  1027. $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~
  1028. $CC $objdir/$soname-exp -Wl,--dll -nostartfiles -Wl,-e,__cygwin_dll_entry@12 -o $lib $objdir/$soname-ltdll.$objext $libobjs $deplibs $linkopts'
  1029. old_archive_from_new_cmds='$DLLTOOL --as=$AS --dllname $soname --def $objdir/$soname-def --output-lib $objdir/$libname.a'
  1030. ;;
  1031. netbsd*)
  1032. $LD --help 2>&1 | egrep ': supported targets:.* elf' > /dev/null
  1033. if test $? != 0; then
  1034. $LD -V 2>&1 | egrep elf > /dev/null
  1035. fi
  1036. if test $? = 0; then
  1037. archive_cmds='$CC -shared $libobjs $deplibs $linkopts ${wl}-soname $wl$soname -o $lib'
  1038. archive_expsym_cmds='$CC -shared $libobjs $deplibs $linkopts ${wl}-soname $wl$soname ${wl}-retain-symbols-file $wl$export_symbols -o $lib'
  1039. else
  1040. archive_cmds='$LD -Bshareable $libobjs $deplibs $linkopts -o $lib'
  1041. # can we support soname and/or expsyms with a.out? -oliva
  1042. fi
  1043. ;;
  1044. solaris*)
  1045. if $LD -v 2>&1 | egrep 'BFD 2\.8' > /dev/null; then
  1046. ld_shlibs=no
  1047. cat <<EOF 1>&2
  1048. *** Warning: The releases 2.8.* of the GNU linker cannot reliably
  1049. *** create shared libraries on Solaris systems. Therefore, libtool
  1050. *** is disabling shared libraries support. We urge you to upgrade GNU
  1051. *** binutils to release 2.9.1 or newer. Another option is to modify
  1052. *** your PATH or compiler configuration so that the native linker is
  1053. *** used, and then restart.
  1054. EOF
  1055. else
  1056. $LD --help 2>&1 | egrep ': supported targets:.* elf' > /dev/null
  1057. if test $? != 0; then
  1058. $LD -V 2>&1 | egrep elf > /dev/null
  1059. fi
  1060. if test $? = 0; then
  1061. archive_cmds='$CC -shared $libobjs $deplibs $linkopts ${wl}-soname $wl$soname -o $lib'
  1062. archive_expsym_cmds='$CC -shared $libobjs $deplibs $linkopts ${wl}-soname $wl$soname ${wl}-retain-symbols-file $wl$export_symbols -o $lib'
  1063. else
  1064. ld_shlibs=no
  1065. fi
  1066. fi
  1067. ;;
  1068. sunos4*)
  1069. archive_cmds='$LD -assert pure-text -Bshareable -o $lib $libobjs $deplibs $linkopts'
  1070. wlarc=
  1071. hardcode_direct=yes
  1072. hardcode_shlibpath_var=no
  1073. ;;
  1074. *)
  1075. $LD --help 2>&1 | egrep ': supported targets:.* elf' > /dev/null
  1076. if test $? != 0; then
  1077. $LD -V 2>&1 | egrep elf > /dev/null
  1078. fi
  1079. if test $? = 0; then
  1080. archive_cmds='$CC -shared $libobjs $deplibs $linkopts ${wl}-soname $wl$soname -o $lib'
  1081. archive_expsym_cmds='$CC -shared $libobjs $deplibs $linkopts ${wl}-soname $wl$soname ${wl}-retain-symbols-file $wl$export_symbols -o $lib'
  1082. else
  1083. ld_shlibs=no
  1084. fi
  1085. ;;
  1086. esac
  1087. if test "$ld_shlibs" = yes; then
  1088. runpath_var=LD_RUN_PATH
  1089. hardcode_libdir_flag_spec='${wl}--rpath ${wl}$libdir'
  1090. export_dynamic_flag_spec='${wl}--export-dynamic'
  1091. case $host_os in
  1092. cygwin* | mingw*)
  1093. # dlltool doesn't understand --whole-archive et. al.
  1094. whole_archive_flag_spec=
  1095. ;;
  1096. *)
  1097. whole_archive_flag_spec="$wlarc"'--whole-archive$convenience '"$wlarc"'--no-whole-archive'
  1098. ;;
  1099. esac
  1100. fi
  1101. else
  1102. # PORTME fill in a description of your system's linker (not GNU ld)
  1103. case "$host_os" in
  1104. aix3*)
  1105. allow_undefined_flag=unsupported
  1106. always_export_symbols=yes
  1107. archive_expsym_cmds='$LD -o $objdir/$soname $libobjs $deplibs $linkopts -bE:$export_symbols -T512 -H512 -bM:SRE~$AR cru $lib $objdir/$soname'
  1108. # Note: this linker hardcodes the directories in LIBPATH if there
  1109. # are no directories specified by -L.
  1110. hardcode_minus_L=yes
  1111. if test "$with_gcc" = yes && test -z "$link_static_flag"; then
  1112. # Neither direct hardcoding nor static linking is supported with a
  1113. # broken collect2.
  1114. hardcode_direct=unsupported
  1115. fi
  1116. ;;
  1117. aix4*)
  1118. hardcode_libdir_flag_spec='${wl}-b ${wl}nolibpath ${wl}-b ${wl}libpath:$libdir:/usr/lib:/lib'
  1119. hardcode_libdir_separator=':'
  1120. if test "$with_gcc" = yes; then
  1121. collect2name=`${CC} -print-prog-name=collect2`
  1122. if test -f "$collect2name" && \
  1123. strings "$collect2name" | grep resolve_lib_name >/dev/null
  1124. then
  1125. # We have reworked collect2
  1126. hardcode_direct=yes
  1127. else
  1128. # We have old collect2
  1129. hardcode_direct=unsupported
  1130. # It fails to find uninstalled libraries when the uninstalled
  1131. # path is not listed in the libpath. Setting hardcode_minus_L
  1132. # to unsupported forces relinking
  1133. hardcode_minus_L=yes
  1134. hardcode_libdir_flag_spec='-L$libdir'
  1135. hardcode_libdir_separator=
  1136. fi
  1137. shared_flag='-shared'
  1138. else
  1139. shared_flag='${wl}-bM:SRE'
  1140. hardcode_direct=yes
  1141. fi
  1142. allow_undefined_flag=' ${wl}-berok'
  1143. archive_cmds="\$CC $shared_flag"' -o $objdir/$soname $libobjs $deplibs $linkopts ${wl}-bexpall ${wl}-bnoentry${allow_undefined_flag}'
  1144. archive_expsym_cmds="\$CC $shared_flag"' -o $objdir/$soname $libobjs $deplibs $linkopts ${wl}-bE:$export_symbols ${wl}-bnoentry${allow_undefined_flag}'
  1145. case "$host_os" in aix4.[01]|aix4.[01].*)
  1146. # According to Greg Wooledge, -bexpall is only supported from AIX 4.2 on
  1147. always_export_symbols=yes ;;
  1148. esac
  1149. ;;
  1150. amigaos*)
  1151. 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)'
  1152. hardcode_libdir_flag_spec='-L$libdir'
  1153. hardcode_minus_L=yes
  1154. # see comment about different semantics on the GNU ld section
  1155. ld_shlibs=no
  1156. ;;
  1157. cygwin* | mingw*)
  1158. # When not using gcc, we currently assume that we are using
  1159. # Microsoft Visual C++.
  1160. # hardcode_libdir_flag_spec is actually meaningless, as there is
  1161. # no search path for DLLs.
  1162. hardcode_libdir_flag_spec=' '
  1163. allow_undefined_flag=unsupported
  1164. # Tell ltmain to make .lib files, not .a files.
  1165. libext=lib
  1166. # FIXME: Setting linknames here is a bad hack.
  1167. archive_cmds='$CC -o $lib $libobjs $linkopts `echo "$deplibs" | sed -e '\''s/ -lc$//'\''` -link -dll~linknames='
  1168. # The linker will automatically build a .lib file if we build a DLL.
  1169. old_archive_from_new_cmds='true'
  1170. # FIXME: Should let the user specify the lib program.
  1171. old_archive_cmds='lib /OUT:$oldlib$oldobjs'
  1172. fix_srcfile_path='`cygpath -w $srcfile`'
  1173. ;;
  1174. freebsd1*)
  1175. ld_shlibs=no
  1176. ;;
  1177. # FreeBSD 2.2.[012] allows us to include c++rt0.o to get C++ constructor
  1178. # support. Future versions do this automatically, but an explicit c++rt0.o
  1179. # does not break anything, and helps significantly (at the cost of a little
  1180. # extra space).
  1181. freebsd2.2*)
  1182. archive_cmds='$LD -Bshareable -o $lib $libobjs $deplibs $linkopts /usr/lib/c++rt0.o'
  1183. hardcode_libdir_flag_spec='-R$libdir'
  1184. hardcode_direct=yes
  1185. hardcode_shlibpath_var=no
  1186. ;;
  1187. # Unfortunately, older versions of FreeBSD 2 do not have this feature.
  1188. freebsd2*)
  1189. archive_cmds='$LD -Bshareable -o $lib $libobjs $deplibs $linkopts'
  1190. hardcode_direct=yes
  1191. hardcode_minus_L=yes
  1192. hardcode_shlibpath_var=no
  1193. ;;
  1194. # FreeBSD 3 and greater uses gcc -shared to do shared libraries.
  1195. freebsd*)
  1196. archive_cmds='$CC -shared -o $lib $libobjs $deplibs $linkopts'
  1197. hardcode_libdir_flag_spec='-R$libdir'
  1198. hardcode_direct=yes
  1199. hardcode_shlibpath_var=no
  1200. ;;
  1201. hpux9* | hpux10* | hpux11*)
  1202. case "$host_os" in
  1203. 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' ;;
  1204. *) archive_cmds='$LD -b +h $soname +b $install_libdir -o $lib $libobjs $deplibs $linkopts' ;;
  1205. esac
  1206. hardcode_libdir_flag_spec='${wl}+b ${wl}$libdir'
  1207. hardcode_libdir_separator=:
  1208. hardcode_direct=yes
  1209. hardcode_minus_L=yes # Not in the search PATH, but as the default
  1210. # location of the library.
  1211. export_dynamic_flag_spec='${wl}-E'
  1212. ;;
  1213. irix5* | irix6*)
  1214. if test "$with_gcc" = yes; then
  1215. 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'
  1216. else
  1217. archive_cmds='$LD -shared $libobjs $deplibs $linkopts -soname $soname `test -n "$verstring" && echo -set_version $verstring` -update_registry ${objdir}/so_locations -o $lib'
  1218. fi
  1219. hardcode_libdir_flag_spec='${wl}-rpath ${wl}$libdir'
  1220. hardcode_libdir_separator=:
  1221. ;;
  1222. netbsd*)
  1223. if echo __ELF__ | $CC -E - | grep __ELF__ >/dev/null; then
  1224. archive_cmds='$LD -Bshareable -o $lib $libobjs $deplibs $linkopts' # a.out
  1225. else
  1226. archive_cmds='$LD -shared -o $lib $libobjs $deplibs $linkopts' # ELF
  1227. fi
  1228. hardcode_libdir_flag_spec='${wl}-R$libdir'
  1229. hardcode_direct=yes
  1230. hardcode_shlibpath_var=no
  1231. ;;
  1232. openbsd*)
  1233. archive_cmds='$LD -Bshareable -o $lib $libobjs $deplibs $linkopts'
  1234. hardcode_libdir_flag_spec='-R$libdir'
  1235. hardcode_direct=yes
  1236. hardcode_shlibpath_var=no
  1237. ;;
  1238. os2*)
  1239. hardcode_libdir_flag_spec='-L$libdir'
  1240. hardcode_minus_L=yes
  1241. allow_undefined_flag=unsupported
  1242. 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'
  1243. old_archive_from_new_cmds='emximp -o $objdir/$libname.a $objdir/$libname.def'
  1244. ;;
  1245. osf3* | osf4*)
  1246. if test "$with_gcc" = yes; then
  1247. allow_undefined_flag=' ${wl}-expect_unresolved ${wl}\*'
  1248. 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'
  1249. else
  1250. allow_undefined_flag=' -expect_unresolved \*'
  1251. 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'
  1252. fi
  1253. hardcode_libdir_flag_spec='${wl}-rpath ${wl}$libdir'
  1254. hardcode_libdir_separator=:
  1255. ;;
  1256. sco3.2v5*)
  1257. archive_cmds='$LD -G -h $soname -o $lib $libobjs $deplibs $linkopts'
  1258. hardcode_shlibpath_var=no
  1259. runpath_var=LD_RUN_PATH
  1260. hardcode_runpath_var=yes
  1261. ;;
  1262. solaris*)
  1263. no_undefined_flag=' -z text'
  1264. # $CC -shared without GNU ld will not create a library from C++
  1265. # object files and a static libstdc++, better avoid it by now
  1266. archive_cmds='$LD -G${allow_undefined_flag} -h $soname -o $lib $libobjs $deplibs $linkopts'
  1267. archive_expsym_cmds='$echo "{ global:" > $lib.exp~cat $export_symbols | sed -e "s/\(.*\)/\1;/" >> $lib.exp~$echo "local: *; };" >> $lib.exp~
  1268. $LD -G${allow_undefined_flag} -M $lib.exp -h $soname -o $lib $libobjs $deplibs $linkopts~$rm $lib.exp'
  1269. hardcode_libdir_flag_spec='-R$libdir'
  1270. hardcode_shlibpath_var=no
  1271. case "$host_os" in
  1272. solaris2.[0-5] | solaris2.[0-5].*) ;;
  1273. *) # Supported since Solaris 2.6 (maybe 2.5.1?)
  1274. whole_archive_flag_spec='-z allextract$convenience -z defaultextract' ;;
  1275. esac
  1276. ;;
  1277. sunos4*)
  1278. archive_cmds='$LD -assert pure-text -Bstatic -o $lib $libobjs $deplibs $linkopts'
  1279. hardcode_libdir_flag_spec='-L$libdir'
  1280. hardcode_direct=yes
  1281. hardcode_minus_L=yes
  1282. hardcode_shlibpath_var=no
  1283. ;;
  1284. sysv4)
  1285. archive_cmds='$LD -G -h $soname -o $lib $libobjs $deplibs $linkopts'
  1286. runpath_var='LD_RUN_PATH'
  1287. hardcode_shlibpath_var=no
  1288. hardcode_direct=no #Motorola manual says yes, but my tests say they lie
  1289. ;;
  1290. sysv4.3*)
  1291. archive_cmds='$LD -G -h $soname -o $lib $libobjs $deplibs $linkopts'
  1292. hardcode_shlibpath_var=no
  1293. export_dynamic_flag_spec='-Bexport'
  1294. ;;
  1295. uts4*)
  1296. archive_cmds='$LD -G -h $soname -o $lib $libobjs $deplibs $linkopts'
  1297. hardcode_libdir_flag_spec='-L$libdir'
  1298. hardcode_shlibpath_var=no
  1299. ;;
  1300. dgux*)
  1301. archive_cmds='$LD -G -h $soname -o $lib $libobjs $deplibs $linkopts'
  1302. hardcode_libdir_flag_spec='-L$libdir'
  1303. hardcode_shlibpath_var=no
  1304. ;;
  1305. sysv4*MP*)
  1306. if test -d /usr/nec ;then
  1307. # archive_cmds='$LD -G -z text -h $soname -o $lib$libobjs$deplibs'
  1308. archive_cmds='$LD -G -h $soname -o $lib$libobjs$deplibs'
  1309. hardcode_shlibpath_var=no
  1310. runpath_var=LD_RUN_PATH
  1311. hardcode_runpath_var=yes
  1312. ld_shlibs=yes
  1313. fi
  1314. ;;
  1315. *)
  1316. ld_shlibs=no
  1317. ;;
  1318. esac
  1319. fi
  1320. echo "$ac_t$ld_shlibs" 1>&6
  1321. test "$ld_shlibs" = no && can_build_shared=no
  1322. if test -z "$NM"; then
  1323. echo $ac_n "checking for BSD-compatible nm... $ac_c" 1>&6
  1324. case "$NM" in
  1325. [\\/]* | [A-Za-z]:[\\/]*) ;; # Let the user override the test with a path.
  1326. *)
  1327. IFS="${IFS= }"; ac_save_ifs="$IFS"; IFS="${IFS}${PATH_SEPARATOR}"
  1328. for ac_dir in $PATH /usr/ucb /usr/ccs/bin /bin; do
  1329. test -z "$ac_dir" && ac_dir=.
  1330. if test -f $ac_dir/nm || test -f $ac_dir/nm$ac_exeext; then
  1331. # Check to see if the nm accepts a BSD-compat flag.
  1332. # Adding the `sed 1q' prevents false positives on HP-UX, which says:
  1333. # nm: unknown option "B" ignored
  1334. if ($ac_dir/nm -B /dev/null 2>&1 | sed '1q'; exit 0) | egrep /dev/null >/dev/null; then
  1335. NM="$ac_dir/nm -B"
  1336. break
  1337. elif ($ac_dir/nm -p /dev/null 2>&1 | sed '1q'; exit 0) | egrep /dev/null >/dev/null; then
  1338. NM="$ac_dir/nm -p"
  1339. break
  1340. else
  1341. NM=${NM="$ac_dir/nm"} # keep the first match, but
  1342. continue # so that we can try to find one that supports BSD flags
  1343. fi
  1344. fi
  1345. done
  1346. IFS="$ac_save_ifs"
  1347. test -z "$NM" && NM=nm
  1348. ;;
  1349. esac
  1350. echo "$ac_t$NM" 1>&6
  1351. fi
  1352. # Check for command to grab the raw symbol name followed by C symbol from nm.
  1353. echo $ac_n "checking command to parse $NM output... $ac_c" 1>&6
  1354. # These are sane defaults that work on at least a few old systems.
  1355. # [They come from Ultrix. What could be older than Ultrix?!! ;)]
  1356. # Character class describing NM global symbol codes.
  1357. symcode='[BCDEGRST]'
  1358. # Regexp to match symbols that can be accessed directly from C.
  1359. sympat='\([_A-Za-z][_A-Za-z0-9]*\)'
  1360. # Transform the above into a raw symbol and a C symbol.
  1361. symxfrm='\1 \2\3 \3'
  1362. # Transform an extracted symbol line into a proper C declaration
  1363. global_symbol_to_cdecl="sed -n -e 's/^. .* \(.*\)$/extern char \1;/p'"
  1364. # Define system-specific variables.
  1365. case "$host_os" in
  1366. aix*)
  1367. symcode='[BCDT]'
  1368. ;;
  1369. cygwin* | mingw*)
  1370. symcode='[ABCDGISTW]'
  1371. ;;
  1372. hpux*) # Its linker distinguishes data from code symbols
  1373. global_symbol_to_cdecl="sed -n -e 's/^T .* \(.*\)$/extern char \1();/p' -e 's/^. .* \(.*\)$/extern char \1;/p'"
  1374. ;;
  1375. irix*)
  1376. symcode='[BCDEGRST]'
  1377. ;;
  1378. solaris*)
  1379. symcode='[BDT]'
  1380. ;;
  1381. sysv4)
  1382. symcode='[DFNSTU]'
  1383. ;;
  1384. esac
  1385. # If we're using GNU nm, then use its standard symbol codes.
  1386. if $NM -V 2>&1 | egrep '(GNU|with BFD)' > /dev/null; then
  1387. symcode='[ABCDGISTW]'
  1388. fi
  1389. # Try without a prefix undercore, then with it.
  1390. for ac_symprfx in "" "_"; do
  1391. # Write the raw and C identifiers.
  1392. global_symbol_pipe="sed -n -e 's/^.*[ ]\($symcode\)[ ][ ]*\($ac_symprfx\)$sympat$/$symxfrm/p'"
  1393. # Check to see that the pipe works correctly.
  1394. pipe_works=no
  1395. $rm conftest*
  1396. cat > conftest.c <<EOF
  1397. #ifdef __cplusplus
  1398. extern "C" {
  1399. #endif
  1400. char nm_test_var;
  1401. void nm_test_fun…

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