You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

1513 lines
42 KiB

25 years ago
  1. #! /bin/sh
  2. # ltconfig - Create a system-specific libtool.
  3. # Copyright (C) 1996-1998 Free Software Foundation, Inc.
  4. # 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. # The HP-UX ksh and POSIX shell print the target directory to stdout
  26. # if CDPATH is set.
  27. if test "${CDPATH+set}" = set; then CDPATH=; export CDPATH; fi
  28. echo=echo
  29. if test "X`($echo '\t') 2>/dev/null`" = 'X\t'; then :
  30. else
  31. # The Solaris and AIX default echo program unquotes backslashes.
  32. # This makes it impossible to quote backslashes using
  33. # echo "$something" | sed 's/\\/\\\\/g'
  34. # So, we emulate echo with printf '%s\n'
  35. echo="printf %s\\n"
  36. if test "X`($echo '\t') 2>/dev/null`" = 'X\t'; then :
  37. else
  38. # Oops. We have no working printf. Try to find a not-so-buggy echo.
  39. echo=echo
  40. IFS="${IFS= }"; save_ifs="$IFS"; IFS="${IFS}:"
  41. for dir in $PATH /usr/ucb; do
  42. if test -f $dir/echo && test "X`$dir/echo '\t'`" = 'X\t'; then
  43. echo="$dir/echo"
  44. break
  45. fi
  46. done
  47. IFS="$save_ifs"
  48. fi
  49. fi
  50. # Sed substitution that helps us do robust quoting. It backslashifies
  51. # metacharacters that are still active within double-quoted strings.
  52. Xsed='sed -e s/^X//'
  53. sed_quote_subst='s/\([\\"\\`$\\\\]\)/\\\1/g'
  54. # Same as above, but do not quote variable references.
  55. double_quote_subst='s/\([\\"\\`\\\\]\)/\\\1/g'
  56. # The name of this program.
  57. progname=`$echo "X$0" | $Xsed -e 's%^.*/%%'`
  58. # Constants:
  59. PROGRAM=ltconfig
  60. PACKAGE=libtool
  61. VERSION=1.2
  62. ac_compile='${CC-cc} -c $CFLAGS $CPPFLAGS conftest.c 1>&5'
  63. ac_link='${CC-cc} -o conftest $CFLAGS $CPPFLAGS $LDFLAGS conftest.c $LIBS 1>&5'
  64. rm="rm -f"
  65. help="Try \`$progname --help' for more information."
  66. # Global variables:
  67. can_build_shared=yes
  68. enable_shared=yes
  69. # All known linkers require a `.a' archive for static linking.
  70. enable_static=yes
  71. ltmain=
  72. silent=
  73. srcdir=
  74. ac_config_guess=
  75. ac_config_sub=
  76. host=
  77. nonopt=
  78. verify_host=yes
  79. with_gcc=no
  80. with_gnu_ld=no
  81. old_AR="$AR"
  82. old_CC="$CC"
  83. old_CFLAGS="$CFLAGS"
  84. old_CPPFLAGS="$CPPFLAGS"
  85. old_LD="$LD"
  86. old_LN_S="$LN_S"
  87. old_NM="$NM"
  88. old_RANLIB="$RANLIB"
  89. # Parse the command line options.
  90. args=
  91. prev=
  92. for option
  93. do
  94. case "$option" in
  95. -*=*) optarg=`echo "$option" | sed 's/[-_a-zA-Z0-9]*=//'` ;;
  96. *) optarg= ;;
  97. esac
  98. # If the previous option needs an argument, assign it.
  99. if test -n "$prev"; then
  100. eval "$prev=\$option"
  101. prev=
  102. continue
  103. fi
  104. case "$option" in
  105. --help) cat <<EOM
  106. Usage: $progname [OPTION]... LTMAIN [HOST]
  107. Generate a system-specific libtool script.
  108. --disable-shared do not build shared libraries
  109. --disable-static do not build static libraries
  110. --help display this help and exit
  111. --no-verify do not verify that HOST is a valid host type
  112. --quiet same as \`--silent'
  113. --silent do not print informational messages
  114. --srcdir=DIR find \`config.guess' in DIR
  115. --version output version information and exit
  116. --with-gcc assume that the GNU C compiler will be used
  117. --with-gnu-ld assume that the C compiler uses the GNU linker
  118. LTMAIN is the \`ltmain.sh' shell script fragment that provides basic libtool
  119. functionality.
  120. HOST is the canonical host system name [default=guessed].
  121. EOM
  122. exit 0
  123. ;;
  124. --disable-shared) enable_shared=no ;;
  125. --disable-static) enable_static=no ;;
  126. --quiet | --silent) silent=yes ;;
  127. --srcdir) prev=srcdir ;;
  128. --srcdir=*) srcdir="$optarg" ;;
  129. --no-verify) verify_host=no ;;
  130. --version) echo "$PROGRAM (GNU $PACKAGE) $VERSION"; exit 0 ;;
  131. --with-gcc) with_gcc=yes ;;
  132. --with-gnu-ld) with_gnu_ld=yes ;;
  133. -*)
  134. echo "$progname: unrecognized option \`$option'" 1>&2
  135. echo "$help" 1>&2
  136. exit 1
  137. ;;
  138. *)
  139. if test -z "$ltmain"; then
  140. ltmain="$option"
  141. elif test -z "$host"; then
  142. # This generates an unnecessary warning for sparc-sun-solaris4.1.3_U1
  143. # if test -n "`echo $option| sed 's/[-a-z0-9.]//g'`"; then
  144. # echo "$progname: warning \`$option' is not a valid host type" 1>&2
  145. # fi
  146. host="$option"
  147. else
  148. echo "$progname: too many arguments" 1>&2
  149. echo "$help" 1>&2
  150. exit 1
  151. fi ;;
  152. esac
  153. done
  154. if test -z "$ltmain"; then
  155. echo "$progname: you must specify a LTMAIN file" 1>&2
  156. echo "$help" 1>&2
  157. exit 1
  158. fi
  159. if test -f "$ltmain"; then :
  160. else
  161. echo "$progname: \`$ltmain' does not exist" 1>&2
  162. echo "$help" 1>&2
  163. exit 1
  164. fi
  165. # Quote any args containing shell metacharacters.
  166. ltconfig_args=
  167. for arg
  168. do
  169. case "$arg" in
  170. *" "*|*" "*|*[\[\]\~\#\$\^\&\*\(\)\{\}\\\|\;\<\>\?]*)
  171. ltconfig_args="$ltconfig_args '$arg'" ;;
  172. *) ltconfig_args="$ltconfig_args $arg" ;;
  173. esac
  174. done
  175. # A relevant subset of AC_INIT.
  176. # File descriptor usage:
  177. # 0 standard input
  178. # 1 file creation
  179. # 2 errors and warnings
  180. # 3 some systems may open it to /dev/tty
  181. # 4 used on the Kubota Titan
  182. # 5 compiler messages saved in config.log
  183. # 6 checking for... messages and results
  184. if test "$silent" = yes; then
  185. exec 6>/dev/null
  186. else
  187. exec 6>&1
  188. fi
  189. exec 5>>./config.log
  190. # NLS nuisances.
  191. # Only set LANG and LC_ALL to C if already set.
  192. # These must not be set unconditionally because not all systems understand
  193. # e.g. LANG=C (notably SCO).
  194. if test "${LC_ALL+set}" = set; then LC_ALL=C; export LC_ALL; fi
  195. if test "${LANG+set}" = set; then LANG=C; export LANG; fi
  196. if (echo "testing\c"; echo 1,2,3) | grep c >/dev/null; then
  197. # Stardent Vistra SVR4 grep lacks -e, says ghazi@caip.rutgers.edu.
  198. if (echo -n testing; echo 1,2,3) | sed s/-n/xn/ | grep xn >/dev/null; then
  199. ac_n= ac_c='
  200. ' ac_t=' '
  201. else
  202. ac_n=-n ac_c= ac_t=
  203. fi
  204. else
  205. ac_n= ac_c='\c' ac_t=
  206. fi
  207. if test -z "$srcdir"; then
  208. # Assume the source directory is the same one as the path to ltmain.sh.
  209. srcdir=`$echo "$ltmain" | $Xsed -e 's%/[^/]*$%%'`
  210. test "$srcdir" = "$ltmain" && srcdir=.
  211. fi
  212. trap "$rm conftest*; exit 1" 1 2 15
  213. if test "$verify_host" = yes; then
  214. # Check for config.guess and config.sub.
  215. ac_aux_dir=
  216. for ac_dir in $srcdir $srcdir/.. $srcdir/../..; do
  217. if test -f $ac_dir/config.guess; then
  218. ac_aux_dir=$ac_dir
  219. break
  220. fi
  221. done
  222. if test -z "$ac_aux_dir"; then
  223. echo "$progname: cannot find config.guess in $srcdir $srcdir/.. $srcdir/../.." 1>&2
  224. echo "$help" 1>&2
  225. exit 1
  226. fi
  227. ac_config_guess=$ac_aux_dir/config.guess
  228. ac_config_sub=$ac_aux_dir/config.sub
  229. # Make sure we can run config.sub.
  230. if $ac_config_sub sun4 >/dev/null 2>&1; then :
  231. else
  232. echo "$progname: cannot run $ac_config_sub" 1>&2
  233. echo "$help" 1>&2
  234. exit 1
  235. fi
  236. echo $ac_n "checking host system type""... $ac_c" 1>&6
  237. host_alias=$host
  238. case "$host_alias" in
  239. "")
  240. if host_alias=`$ac_config_guess`; then :
  241. else
  242. echo "$progname: cannot guess host type; you must specify one" 1>&2
  243. echo "$help" 1>&2
  244. exit 1
  245. fi ;;
  246. esac
  247. host=`$ac_config_sub $host_alias`
  248. echo "$ac_t$host" 1>&6
  249. # Make sure the host verified.
  250. test -z "$host" && exit 1
  251. elif test -z "$host"; then
  252. echo "$progname: you must specify a host type if you use \`--no-verify'" 1>&2
  253. echo "$help" 1>&2
  254. exit 1
  255. else
  256. host_alias=$host
  257. fi
  258. # Transform linux* to *-*-linux-gnu*, to support old configure scripts.
  259. host_os=`echo $host | sed 's/^\([^-]*\)-\([^-]*\)-\(.*\)$/\3/'`
  260. case "$host_os" in
  261. linux-gnu*) ;;
  262. linux*) host=`echo $host | sed 's/^\(.*-.*-linux\)\(.*\)$/\1-gnu\2/'`
  263. esac
  264. host_cpu=`echo $host | sed 's/^\([^-]*\)-\([^-]*\)-\(.*\)$/\1/'`
  265. host_vendor=`echo $host | sed 's/^\([^-]*\)-\([^-]*\)-\(.*\)$/\2/'`
  266. host_os=`echo $host | sed 's/^\([^-]*\)-\([^-]*\)-\(.*\)$/\3/'`
  267. case "$host_os" in
  268. aix3*)
  269. # AIX sometimes has problems with the GCC collect2 program. For some
  270. # reason, if we set the COLLECT_NAMES environment variable, the problems
  271. # vanish in a puff of smoke.
  272. if test "${COLLECT_NAMES+set}" != set; then
  273. COLLECT_NAMES=
  274. export COLLECT_NAMES
  275. fi
  276. ;;
  277. esac
  278. # Determine commands to create old-style static archives.
  279. old_archive_cmds='$AR cru $oldlib$oldobjs'
  280. old_postinstall_cmds='chmod 644 $oldlib'
  281. old_postuninstall_cmds=
  282. # Set a sane default for `AR'.
  283. test -z "$AR" && AR=ar
  284. # If RANLIB is not set, then run the test.
  285. if test "${RANLIB+set}" != "set"; then
  286. result=no
  287. echo $ac_n "checking for ranlib... $ac_c" 1>&6
  288. IFS="${IFS= }"; save_ifs="$IFS"; IFS="${IFS}:"
  289. for dir in $PATH; do
  290. test -z "$dir" && dir=.
  291. if test -f $dir/ranlib; then
  292. RANLIB="ranlib"
  293. result="ranlib"
  294. break
  295. fi
  296. done
  297. IFS="$save_ifs"
  298. echo "$ac_t$result" 1>&6
  299. fi
  300. if test -n "$RANLIB"; then
  301. old_archive_cmds="$old_archive_cmds;\$RANLIB \$oldlib"
  302. old_postinstall_cmds="\$RANLIB \$oldlib;$old_postinstall_cmds"
  303. fi
  304. # Check to see if we are using GCC.
  305. if test "$with_gcc" != yes || test -z "$CC"; then
  306. # If CC is not set, then try to find GCC or a usable CC.
  307. if test -z "$CC"; then
  308. echo $ac_n "checking for gcc... $ac_c" 1>&6
  309. IFS="${IFS= }"; save_ifs="$IFS"; IFS="${IFS}:"
  310. for dir in $PATH; do
  311. IFS="$save_ifs"
  312. test -z "$dir" && dir=.
  313. if test -f $dir/gcc; then
  314. CC="gcc"
  315. break
  316. fi
  317. done
  318. IFS="$save_ifs"
  319. if test -n "$CC"; then
  320. echo "$ac_t$CC" 1>&6
  321. else
  322. echo "$ac_t"no 1>&6
  323. fi
  324. fi
  325. # Not "gcc", so try "cc", rejecting "/usr/ucb/cc".
  326. if test -z "$CC"; then
  327. echo $ac_n "checking for cc... $ac_c" 1>&6
  328. IFS="${IFS= }"; save_ifs="$IFS"; IFS="${IFS}:"
  329. cc_rejected=no
  330. for dir in $PATH; do
  331. test -z "$dir" && dir=.
  332. if test -f $dir/cc; then
  333. if test "$dir/cc" = "/usr/ucb/cc"; then
  334. cc_rejected=yes
  335. continue
  336. fi
  337. CC="cc"
  338. break
  339. fi
  340. done
  341. IFS="$save_ifs"
  342. if test $cc_rejected = yes; then
  343. # We found a bogon in the path, so make sure we never use it.
  344. set dummy $CC
  345. shift
  346. if test $# -gt 0; then
  347. # We chose a different compiler from the bogus one.
  348. # However, it has the same name, so the bogon will be chosen
  349. # first if we set CC to just the name; use the full file name.
  350. shift
  351. set dummy "$dir/cc" "$@"
  352. shift
  353. CC="$@"
  354. fi
  355. fi
  356. if test -n "$CC"; then
  357. echo "$ac_t$CC" 1>&6
  358. else
  359. echo "$ac_t"no 1>&6
  360. fi
  361. if test -z "$CC"; then
  362. echo "$progname: error: no acceptable cc found in \$PATH" 1>&2
  363. exit 1
  364. fi
  365. fi
  366. # Now see if the compiler is really GCC.
  367. with_gcc=no
  368. echo $ac_n "checking whether we are using GNU C... $ac_c" 1>&6
  369. echo "$progname:424: checking whether we are using GNU C" >&5
  370. $rm conftest.c
  371. cat > conftest.c <<EOF
  372. #ifdef __GNUC__
  373. yes;
  374. #endif
  375. EOF
  376. if { ac_try='${CC-cc} -E conftest.c'; { (eval echo $progname:432: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }; } | egrep yes >/dev/null 2>&1; then
  377. with_gcc=yes
  378. fi
  379. $rm conftest.c
  380. echo "$ac_t$with_gcc" 1>&6
  381. fi
  382. # Allow CC to be a program name with arguments.
  383. set dummy $CC
  384. compiler="$2"
  385. echo $ac_n "checking for $compiler option to produce PIC... $ac_c" 1>&6
  386. pic_flag=
  387. special_shlib_compile_flags=
  388. wl=
  389. link_static_flag=
  390. no_builtin_flag=
  391. if test "$with_gcc" = yes; then
  392. wl='-Wl,'
  393. link_static_flag='-static'
  394. no_builtin_flag=' -fno-builtin'
  395. case "$host_os" in
  396. aix3* | aix4* | irix5* | irix6* | osf3* | osf4*)
  397. # PIC is the default for these OSes.
  398. ;;
  399. os2*)
  400. # We can build DLLs from non-PIC.
  401. ;;
  402. amigaos*)
  403. # FIXME: we need at least 68020 code to build shared libraries, but
  404. # adding the `-m68020' flag to GCC prevents building anything better,
  405. # like `-m68040'.
  406. pic_flag='-m68020 -resident32 -malways-restore-a4'
  407. ;;
  408. *)
  409. pic_flag='-fPIC'
  410. ;;
  411. esac
  412. else
  413. # PORTME Check for PIC flags for the system compiler.
  414. case "$host_os" in
  415. aix3* | aix4*)
  416. # All AIX code is PIC.
  417. link_static_flag='-bnso -bI:/lib/syscalls.exp'
  418. ;;
  419. hpux9* | hpux10*)
  420. # Is there a better link_static_flag that works with the bundled CC?
  421. wl='-Wl,'
  422. link_static_flag="${wl}-a ${wl}archive"
  423. pic_flag='+Z'
  424. ;;
  425. irix5* | irix6*)
  426. wl='-Wl,'
  427. link_static_flag='-non_shared'
  428. # PIC (with -KPIC) is the default.
  429. ;;
  430. os2*)
  431. # We can build DLLs from non-PIC.
  432. ;;
  433. osf3* | osf4*)
  434. # All OSF/1 code is PIC.
  435. wl='-Wl,'
  436. link_static_flag='-non_shared'
  437. ;;
  438. sco3.2v5*)
  439. pic_flag='-Kpic'
  440. link_static_flag='-dn'
  441. special_shlib_compile_flags='-belf'
  442. ;;
  443. solaris2*)
  444. pic_flag='-KPIC'
  445. link_static_flag='-Bstatic'
  446. wl='-Wl,'
  447. ;;
  448. sunos4*)
  449. pic_flag='-PIC'
  450. link_static_flag='-Bstatic'
  451. wl='-Qoption ld '
  452. ;;
  453. sysv4.2uw2*)
  454. pic_flag='-KPIC'
  455. link_static_flag='-Bstatic'
  456. wl='-Wl,'
  457. ;;
  458. uts4*)
  459. pic_flag='-pic'
  460. link_static_flag='-Bstatic'
  461. ;;
  462. *)
  463. can_build_shared=no
  464. ;;
  465. esac
  466. fi
  467. if test -n "$pic_flag"; then
  468. echo "$ac_t$pic_flag" 1>&6
  469. # Check to make sure the pic_flag actually works.
  470. echo $ac_n "checking if $compiler PIC flag $pic_flag works... $ac_c" 1>&6
  471. $rm conftest*
  472. echo 'int x;' > conftest.c
  473. save_CFLAGS="$CFLAGS"
  474. CFLAGS="$CFLAGS $pic_flag -DPIC"
  475. echo "$progname:547: checking if $compiler PIC flag $pic_flag works" >&5
  476. if { (eval echo $progname:548: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>conftest.err; } && test -s conftest.o; then
  477. # Append any warnings to the config.log.
  478. cat conftest.err 1>&5
  479. # On HP-UX, both CC and GCC only warn that PIC is supported... then they
  480. # create non-PIC objects. So, if there were any warnings, we assume that
  481. # PIC is not supported.
  482. if test -s conftest.err; then
  483. echo "$ac_t"no 1>&6
  484. can_build_shared=no
  485. pic_flag=
  486. else
  487. echo "$ac_t"yes 1>&6
  488. pic_flag=" $pic_flag"
  489. fi
  490. else
  491. # Append any errors to the config.log.
  492. cat conftest.err 1>&5
  493. can_build_shared=no
  494. pic_flag=
  495. echo "$ac_t"no 1>&6
  496. fi
  497. CFLAGS="$save_CFLAGS"
  498. $rm conftest*
  499. else
  500. echo "$ac_t"none 1>&6
  501. fi
  502. # Check for any special shared library compilation flags.
  503. if test -n "$special_shlib_compile_flags"; then
  504. echo "$progname: warning: \`$CC' requires \`$special_shlib_compile_flags' to build shared libraries" 1>&2
  505. if echo "$old_CC $old_CFLAGS " | egrep -e "[ ]$special_shlib_compile_flags[ ]" >/dev/null; then :
  506. else
  507. echo "$progname: add \`$special_shlib_compile_flags' to the CC or CFLAGS env variable and reconfigure" 1>&2
  508. can_build_shared=no
  509. fi
  510. fi
  511. echo $ac_n "checking if $compiler static flag $link_static_flag works... $ac_c" 1>&6
  512. $rm conftest*
  513. echo 'main(){return(0);}' > conftest.c
  514. save_LDFLAGS="$LDFLAGS"
  515. LDFLAGS="$LDFLAGS $link_static_flag"
  516. echo "$progname:591: checking if $compiler static flag $link_static_flag works" >&5
  517. if { (eval echo $progname:592: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest; then
  518. echo "$ac_t$link_static_flag" 1>&6
  519. else
  520. echo "$ac_t"none 1>&6
  521. link_static_flag=
  522. fi
  523. LDFLAGS="$save_LDFLAGS"
  524. $rm conftest*
  525. if test -z "$LN_S"; then
  526. # Check to see if we can use ln -s, or we need hard links.
  527. echo $ac_n "checking whether ln -s works... $ac_c" 1>&6
  528. $rm conftestdata
  529. if ln -s X conftestdata 2>/dev/null; then
  530. $rm conftestdata
  531. LN_S="ln -s"
  532. else
  533. LN_S=ln
  534. fi
  535. if test "$LN_S" = "ln -s"; then
  536. echo "$ac_t"yes 1>&6
  537. else
  538. echo "$ac_t"no 1>&6
  539. fi
  540. fi
  541. # Make sure LD is an absolute path.
  542. if test -z "$LD"; then
  543. ac_prog=ld
  544. if test "$with_gcc" = yes; then
  545. # Check if gcc -print-prog-name=ld gives a path.
  546. echo $ac_n "checking for ld used by GCC... $ac_c" 1>&6
  547. echo "$progname:624: checking for ld used by GCC" >&5
  548. ac_prog=`($CC -print-prog-name=ld) 2>&5`
  549. case "$ac_prog" in
  550. # Accept absolute paths.
  551. /* | [A-Za-z]:\\*)
  552. test -z "$LD" && LD="$ac_prog"
  553. ;;
  554. "")
  555. # If it fails, then pretend we are not using GCC.
  556. ac_prog=ld
  557. ;;
  558. *)
  559. # If it is relative, then search for the first ld in PATH.
  560. with_gnu_ld=unknown
  561. ;;
  562. esac
  563. elif test "$with_gnu_ld" = yes; then
  564. echo $ac_n "checking for GNU ld... $ac_c" 1>&6
  565. echo "$progname:642: checking for GNU ld" >&5
  566. else
  567. echo $ac_n "checking for non-GNU ld""... $ac_c" 1>&6
  568. echo "$progname:645: checking for non-GNU ld" >&5
  569. fi
  570. if test -z "$LD"; then
  571. IFS="${IFS= }"; ac_save_ifs="$IFS"; IFS="${IFS}:"
  572. for ac_dir in $PATH; do
  573. test -z "$ac_dir" && ac_dir=.
  574. if test -f "$ac_dir/$ac_prog"; then
  575. LD="$ac_dir/$ac_prog"
  576. # Check to see if the program is GNU ld. I'd rather use --version,
  577. # but apparently some GNU ld's only accept -v.
  578. # Break only if it was the GNU/non-GNU ld that we prefer.
  579. if "$LD" -v 2>&1 < /dev/null | egrep '(GNU|with BFD)' > /dev/null; then
  580. test "$with_gnu_ld" != no && break
  581. else
  582. test "$with_gnu_ld" != yes && break
  583. fi
  584. fi
  585. done
  586. IFS="$ac_save_ifs"
  587. fi
  588. if test -n "$LD"; then
  589. echo "$ac_t$LD" 1>&6
  590. else
  591. echo "$ac_t"no 1>&6
  592. fi
  593. if test -z "$LD"; then
  594. echo "$progname: error: no acceptable ld found in \$PATH" 1>&2
  595. exit 1
  596. fi
  597. fi
  598. # Check to see if it really is or is not GNU ld.
  599. echo $ac_n "checking if the linker ($LD) is GNU ld... $ac_c" 1>&6
  600. # I'd rather use --version here, but apparently some GNU ld's only accept -v.
  601. if $LD -v 2>&1 </dev/null | egrep '(GNU|with BFD)' 1>&5; then
  602. with_gnu_ld=yes
  603. else
  604. with_gnu_ld=no
  605. fi
  606. echo "$ac_t$with_gnu_ld" 1>&6
  607. # See if the linker supports building shared libraries.
  608. echo $ac_n "checking whether the linker ($LD) supports shared libraries... $ac_c" 1>&6
  609. allow_undefined_flag=
  610. no_undefined_flag=
  611. archive_cmds=
  612. old_archive_from_new_cmds=
  613. export_dynamic_flag_spec=
  614. hardcode_libdir_flag_spec=
  615. hardcode_libdir_separator=
  616. hardcode_direct=no
  617. hardcode_minus_L=no
  618. hardcode_shlibpath_var=unsupported
  619. runpath_var=
  620. case "$host_os" in
  621. amigaos* | sunos4*)
  622. # On these operating systems, we should treat GNU ld like the system ld.
  623. gnu_ld_acts_native=yes
  624. ;;
  625. *)
  626. gnu_ld_acts_native=no
  627. ;;
  628. esac
  629. ld_shlibs=yes
  630. if test "$with_gnu_ld" = yes && test "$gnu_ld_acts_native" != yes; then
  631. # See if GNU ld supports shared libraries.
  632. if $LD --help 2>&1 | egrep ': supported targets:.* elf' > /dev/null; then
  633. archive_cmds='$CC -shared ${wl}-soname $wl$soname -o $lib$libobjs'
  634. runpath_var=LD_RUN_PATH
  635. ld_shlibs=yes
  636. else
  637. ld_shlibs=no
  638. fi
  639. if test "$ld_shlibs" = yes; then
  640. hardcode_libdir_flag_spec='${wl}--rpath ${wl}$libdir'
  641. export_dynamic_flag_spec='${wl}--export-dynamic'
  642. fi
  643. else
  644. # PORTME fill in a description of your system's linker (not GNU ld)
  645. case "$host_os" in
  646. aix3*)
  647. allow_undefined_flag=unsupported
  648. archive_cmds='$NM$libobjs | $global_symbol_pipe | sed '\''s/.* //'\'' > $lib.exp;$LD -o $objdir/$soname$libobjs -bE:$lib.exp -T512 -H512 -bM:SRE;$AR cru $lib $objdir/$soname'
  649. # Note: this linker hardcodes the directories in LIBPATH if there
  650. # are no directories specified by -L.
  651. hardcode_minus_L=yes
  652. if test "$with_gcc" = yes && test -z "$link_static_flag"; then
  653. # Neither direct hardcoding nor static linking is supported with a
  654. # broken collect2.
  655. hardcode_direct=unsupported
  656. fi
  657. ;;
  658. aix4*)
  659. allow_undefined_flag=unsupported
  660. archive_cmds='$NM$libobjs | $global_symbol_pipe | sed '\''s/.* //'\'' > $lib.exp;$CC -o $objdir/$soname$libobjs ${wl}-bE:$lib.exp ${wl}-bM:SRE ${wl}-bnoentry;$AR cru $lib $objdir/$soname'
  661. hardcode_direct=yes
  662. hardcode_minus_L=yes
  663. ;;
  664. amigaos*)
  665. 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)'
  666. hardcode_libdir_flag_spec='-L$libdir'
  667. hardcode_minus_L=yes
  668. ;;
  669. # FreeBSD 2.2.[012] allows us to include c++rt0.o to get C++ constructor
  670. # support. Future versions do this automatically, but an explicit c++rt0.o
  671. # does not break anything, and helps significantly (at the cost of a little
  672. # extra space).
  673. freebsd2.2*)
  674. archive_cmds='$LD -Bshareable -o $lib$libobjs /usr/lib/c++rt0.o'
  675. hardcode_libdir_flag_spec='-R$libdir'
  676. hardcode_direct=yes
  677. hardcode_minus_L=yes
  678. hardcode_shlibpath_var=no
  679. ;;
  680. # Unfortunately, older versions of FreeBSD 2 do not have this feature.
  681. freebsd2*)
  682. archive_cmds='$LD -Bshareable -o $lib$libobjs'
  683. hardcode_direct=yes
  684. hardcode_minus_L=yes
  685. hardcode_shlibpath_var=no
  686. ;;
  687. # FreeBSD 3, at last, uses gcc -shared to do shared libraries.
  688. freebsd3 | freebsdelf3*)
  689. archive_cmds='$CC -shared -o $lib$libobjs'
  690. hardcode_libdir_flag_spec='-R$libdir'
  691. hardcode_direct=yes
  692. hardcode_minus_L=yes
  693. hardcode_shlibpath_var=no
  694. ;;
  695. hpux9*)
  696. archive_cmds='$rm $objdir/$soname;$LD -b +s +b $install_libdir -o $objdir/$soname$libobjs;mv $objdir/$soname $lib'
  697. hardcode_libdir_flag_spec='${wl}+b ${wl}$libdir'
  698. hardcode_direct=yes
  699. hardcode_minus_L=yes
  700. export_dynamic_flag_spec='${wl}-E'
  701. ;;
  702. hpux10*)
  703. archive_cmds='$LD -b +h $soname +s +b $install_libdir -o $lib$libobjs'
  704. hardcode_libdir_flag_spec='${wl}+b ${wl}$libdir'
  705. hardcode_direct=yes
  706. hardcode_minus_L=yes
  707. export_dynamic_flag_spec='${wl}-E'
  708. ;;
  709. irix5* | irix6*)
  710. archive_cmds='$LD -shared -o $lib -soname $soname -set_version $verstring$libobjs'
  711. hardcode_libdir_flag_spec='${wl}-rpath ${wl}$libdir'
  712. ;;
  713. netbsd*)
  714. # Tested with NetBSD 1.2 ld
  715. archive_cmds='$LD -Bshareable -o $lib$libobjs'
  716. hardcode_libdir_flag_spec='-R$libdir'
  717. hardcode_direct=yes
  718. hardcode_shlibpath_var=no
  719. ;;
  720. openbsd*)
  721. archive_cmds='$LD -Bshareable -o $lib$libobjs'
  722. hardcode_libdir_flag_spec='-R$libdir'
  723. hardcode_direct=yes
  724. hardcode_shlibpath_var=no
  725. ;;
  726. os2*)
  727. hardcode_libdir_flag_spec='-L$libdir'
  728. hardcode_minus_L=yes
  729. allow_undefined_flag=unsupported
  730. 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 $objdir/$libname.def'
  731. old_archive_from_new_cmds='emximp -o $objdir/$libname.a $objdir/$libname.def'
  732. ;;
  733. osf3* | osf4*)
  734. allow_undefined_flag=' -expect_unresolved \*'
  735. archive_cmds='$LD -shared${allow_undefined_flag} -o $lib -soname $soname -set_version $verstring$libobjs$deplibs'
  736. hardcode_libdir_flag_spec='${wl}-rpath ${wl}$libdir'
  737. hardcode_libdir_separator=:
  738. ;;
  739. sco3.2v5*)
  740. archive_cmds='$LD -G -o $lib$libobjs'
  741. hardcode_direct=yes
  742. ;;
  743. solaris2*)
  744. no_undefined_flag=' -z text'
  745. archive_cmds='$LD -G${allow_undefined_flag} -h $soname -o $lib$libobjs'
  746. hardcode_libdir_flag_spec='-R$libdir'
  747. hardcode_shlibpath_var=no
  748. # Solaris 2 before 2.5 hardcodes -L paths.
  749. case "$host_os" in
  750. solaris2.[0-4]*)
  751. hardcode_minus_L=yes
  752. ;;
  753. esac
  754. ;;
  755. sunos4*)
  756. if test "$with_gcc" = yes; then
  757. archive_cmds='$CC -shared -o $lib$libobjs'
  758. else
  759. archive_cmds='$LD -assert pure-text -Bstatic -o $lib$libobjs'
  760. fi
  761. if test "$with_gnu_ld" = yes; then
  762. export_dynamic_flag_spec='${wl}-export-dynamic'
  763. fi
  764. hardcode_libdir_flag_spec='-L$libdir'
  765. hardcode_direct=yes
  766. hardcode_minus_L=yes
  767. hardcode_shlibpath_var=no
  768. ;;
  769. uts4*)
  770. archive_cmds='$LD -G -h $soname -o $lib$libobjs'
  771. hardcode_libdir_flag_spec='-L$libdir'
  772. hardcode_direct=no
  773. hardcode_minus_L=no
  774. hardcode_shlibpath_var=no
  775. ;;
  776. *)
  777. ld_shlibs=no
  778. can_build_shared=no
  779. ;;
  780. esac
  781. fi
  782. echo "$ac_t$ld_shlibs" 1>&6
  783. if test -z "$NM"; then
  784. echo $ac_n "checking for BSD-compatible nm... $ac_c" 1>&6
  785. case "$NM" in
  786. /* | [A-Za-z]:\\*) ;; # Let the user override the test with a path.
  787. *)
  788. IFS="${IFS= }"; ac_save_ifs="$IFS"; IFS="${IFS}:"
  789. for ac_dir in /usr/ucb /usr/ccs/bin $PATH /bin; do
  790. test -z "$ac_dir" && ac_dir=.
  791. if test -f $ac_dir/nm; then
  792. # Check to see if the nm accepts a BSD-compat flag.
  793. # Adding the `sed 1q' prevents false positives on HP-UX, which says:
  794. # nm: unknown option "B" ignored
  795. if ($ac_dir/nm -B /dev/null 2>&1 | sed '1q'; exit 0) | egrep /dev/null >/dev/null; then
  796. NM="$ac_dir/nm -B"
  797. elif ($ac_dir/nm -p /dev/null 2>&1 | sed '1q'; exit 0) | egrep /dev/null >/dev/null; then
  798. NM="$ac_dir/nm -p"
  799. else
  800. NM="$ac_dir/nm"
  801. fi
  802. break
  803. fi
  804. done
  805. IFS="$ac_save_ifs"
  806. test -z "$NM" && NM=nm
  807. ;;
  808. esac
  809. echo "$ac_t$NM" 1>&6
  810. fi
  811. # Check for command to grab the raw symbol name followed by C symbol from nm.
  812. echo $ac_n "checking command to parse $NM output... $ac_c" 1>&6
  813. # These are sane defaults that work on at least a few old systems.
  814. # [They come from Ultrix. What could be older than Ultrix?!! ;)]
  815. # Character class describing NM global symbol codes.
  816. symcode='[BCDEGRSTU]'
  817. # Regexp to match symbols that can be accessed directly from C.
  818. sympat='\([_A-Za-z][_A-Za-z0-9]*\)'
  819. # Transform the above into a raw symbol and a C symbol.
  820. symxfrm='\1 \1'
  821. # Define system-specific variables.
  822. case "$host_os" in
  823. aix*)
  824. symcode='[BCDTU]'
  825. ;;
  826. irix*)
  827. # Cannot use undefined symbols on IRIX because inlined functions mess us up.
  828. symcode='[BCDEGRST]'
  829. ;;
  830. solaris2*)
  831. symcode='[BDTU]'
  832. ;;
  833. esac
  834. # If we're using GNU nm, then use its standard symbol codes.
  835. if $NM -V 2>&1 | egrep '(GNU|with BFD)' > /dev/null; then
  836. symcode='[ABCDGISTUW]'
  837. fi
  838. # Write the raw and C identifiers.
  839. global_symbol_pipe="sed -n -e 's/^.* $symcode $sympat$/$symxfrm/p'"
  840. # Check to see that the pipe works correctly.
  841. pipe_works=no
  842. $rm conftest*
  843. cat > conftest.c <<EOF
  844. #ifdef __cplusplus
  845. extern "C" {
  846. #endif
  847. char nm_test_var;
  848. void nm_test_func(){}
  849. #ifdef __cplusplus
  850. }
  851. #endif
  852. main(){nm_test_var='a';nm_test_func();return(0);}
  853. EOF
  854. echo "$progname:971: checking if global_symbol_pipe works" >&5
  855. if { (eval echo $progname:972: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; } && test -s conftest.o; then
  856. # Now try to grab the symbols.
  857. nlist=conftest.nm
  858. if { echo "$progname:975: eval \"$NM conftest.o | $global_symbol_pipe > $nlist\"" >&5; eval "$NM conftest.o | $global_symbol_pipe > $nlist 2>&5"; } && test -s "$nlist"; then
  859. # Try sorting and uniquifying the output.
  860. if sort "$nlist" | uniq > "$nlist"T; then
  861. mv -f "$nlist"T "$nlist"
  862. wcout=`wc "$nlist" 2>/dev/null`
  863. count=`$echo "X$wcout" | $Xsed -e 's/^[ ]*\([0-9][0-9]*\).*$/\1/'`
  864. (test "$count" -ge 0) 2>/dev/null || count=-1
  865. else
  866. rm -f "$nlist"T
  867. count=-1
  868. fi
  869. # Make sure that we snagged all the symbols we need.
  870. if egrep ' nm_test_var$' "$nlist" >/dev/null; then
  871. if egrep ' nm_test_func$' "$nlist" >/dev/null; then
  872. cat <<EOF > conftest.c
  873. #ifdef __cplusplus
  874. extern "C" {
  875. #endif
  876. EOF
  877. # Now generate the symbol file.
  878. sed 's/^.* \(.*\)$/extern char \1;/' < "$nlist" >> conftest.c
  879. cat <<EOF >> conftest.c
  880. #if defined (__STDC__) && __STDC__
  881. # define __ptr_t void *
  882. #else
  883. # define __ptr_t char *
  884. #endif
  885. /* The number of symbols in dld_preloaded_symbols, -1 if unsorted. */
  886. int dld_preloaded_symbol_count = $count;
  887. /* The mapping between symbol names and symbols. */
  888. struct {
  889. char *name;
  890. __ptr_t address;
  891. }
  892. dld_preloaded_symbols[] =
  893. {
  894. EOF
  895. sed 's/^\(.*\) \(.*\)$/ {"\1", (__ptr_t) \&\2},/' < "$nlist" >> conftest.c
  896. cat <<\EOF >> conftest.c
  897. {0, (__ptr_t) 0}
  898. };
  899. #ifdef __cplusplus
  900. }
  901. #endif
  902. EOF
  903. # Now try linking the two files.
  904. mv conftest.o conftestm.o
  905. save_LIBS="$LIBS"
  906. save_CFLAGS="$CFLAGS"
  907. LIBS='conftestm.o'
  908. CFLAGS="$CFLAGS$no_builtin_flag"
  909. if { (eval echo $progname:1033: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest; then
  910. pipe_works=yes
  911. else
  912. echo "$progname: failed program was:" >&5
  913. cat conftest.c >&5
  914. fi
  915. LIBS="$save_LIBS"
  916. else
  917. echo "cannot find nm_test_func in $nlist" >&5
  918. fi
  919. else
  920. echo "cannot find nm_test_var in $nlist" >&5
  921. fi
  922. else
  923. echo "cannot run $global_symbol_pipe" >&5
  924. fi
  925. else
  926. echo "$progname: failed program was:" >&5
  927. cat conftest.c >&5
  928. fi
  929. $rm conftest*
  930. # Do not use the global_symbol_pipe unless it works.
  931. echo "$ac_t$pipe_works" 1>&6
  932. test "$pipe_works" = yes || global_symbol_pipe=
  933. # Check hardcoding attributes.
  934. echo $ac_n "checking how to hardcode library paths into programs... $ac_c" 1>&6
  935. hardcode_action=
  936. if test -n "$hardcode_libdir_flag_spec" || \
  937. test -n "$runpath_var"; then
  938. # We can hardcode non-existant directories.
  939. if test "$hardcode_direct" != no && \
  940. test "$hardcode_minus_L" != no && \
  941. test "$hardcode_shlibpath_var" != no; then
  942. # Linking always hardcodes the temporary library directory.
  943. hardcode_action=relink
  944. else
  945. # We can link without hardcoding, and we can hardcode nonexisting dirs.
  946. hardcode_action=immediate
  947. fi
  948. elif test "$hardcode_direct" != yes && \
  949. test "$hardcode_minus_L" != yes && \
  950. test "$hardcode_shlibpath_var" != yes; then
  951. # We cannot hardcode anything.
  952. hardcode_action=unsupported
  953. else
  954. # We can only hardcode existing directories.
  955. hardcode_action=relink
  956. fi
  957. echo "$ac_t$hardcode_action" 1>&6
  958. test "$hardcode_action" = unsupported && can_build_shared=no
  959. reload_flag=
  960. reload_cmds='$LD$reload_flag -o $output$reload_objs'
  961. echo $ac_n "checking for $LD option to produce relocatable object files... $ac_c" 1>&6
  962. # PORTME Some linker may need a different reload flag.
  963. reload_flag='-r'
  964. echo "$ac_t$reload_flag"
  965. test -n "$reload_flag" && reload_flag=" $reload_flag"
  966. # PORTME Fill in your ld.so characteristics
  967. library_names_spec=
  968. libname_spec='lib$name'
  969. soname_spec=
  970. postinstall_cmds=
  971. postuninstall_cmds=
  972. finish_cmds=
  973. finish_eval=
  974. shlibpath_var=
  975. version_type=none
  976. dynamic_linker="$host_os ld.so"
  977. echo $ac_n "checking dynamic linker characteristics... $ac_c" 1>&6
  978. case "$host_os" in
  979. aix3* | aix4*)
  980. version_type=linux
  981. library_names_spec='${libname}${release}.so.$versuffix $libname.a'
  982. shlibpath_var=LIBPATH
  983. # AIX has no versioning support, so we append a major version to the name.
  984. soname_spec='${libname}${release}.so.$major'
  985. ;;
  986. amigaos*)
  987. library_names_spec='$libname.ixlibrary $libname.a'
  988. # Create ${libname}_ixlibrary.a entries in /sys/libs.
  989. finish_eval='for lib in `ls $libdir/*.ixlibrary 2>/dev/null`; do libname=`$echo "X$lib" | $Xsed -e '\''s%^.*/\([^/]*\)\.ixlibrary$%\1%'\''`; test $rm /sys/libs/${libname}_ixlibrary.a; $show "(cd /sys/libs && $LN_S $lib ${libname}_ixlibrary.a)"; (cd /sys/libs && $LN_S $lib ${libname}_ixlibrary.a) || exit 1; done'
  990. ;;
  991. freebsd2* | freebsd3 | freebsdelf3*)
  992. version_type=sunos
  993. library_names_spec='${libname}${release}.so.$versuffix $libname.so'
  994. finish_cmds='PATH="$PATH:/sbin" ldconfig -m $libdir'
  995. shlibpath_var=LD_LIBRARY_PATH
  996. ;;
  997. gnu*)
  998. version_type=sunos
  999. library_names_spec='${libname}${release}.so.$versuffix'
  1000. shlibpath_var=LD_LIBRARY_PATH
  1001. ;;
  1002. hpux9* | hpux10*)
  1003. # Give a soname corresponding to the major version so that dld.sl refuses to
  1004. # link against other versions.
  1005. dynamic_linker="$host_os dld.sl"
  1006. version_type=sunos
  1007. shlibpath_var=SHLIB_PATH
  1008. library_names_spec='${libname}${release}.sl.$versuffix ${libname}${release}.sl.$major $libname.sl'
  1009. soname_spec='${libname}${release}.sl.$major'
  1010. # HP-UX runs *really* slowly unless shared libraries are mode 555.
  1011. postinstall_cmds='chmod 555 $lib'
  1012. ;;
  1013. irix5* | irix6*)
  1014. version_type=osf
  1015. soname_spec='${libname}${release}.so'
  1016. library_names_spec='${libname}${release}.so.$versuffix $libname.so'
  1017. shlibpath_var=LD_LIBRARY_PATH
  1018. ;;
  1019. # No shared lib support for Linux oldld, aout, or coff.
  1020. linux-gnuoldld* | linux-gnuaout* | linux-gnucoff*)
  1021. dynamic_linker=no
  1022. ;;
  1023. # This must be Linux ELF.
  1024. linux-gnu*)
  1025. version_type=linux
  1026. library_names_spec='${libname}${release}.so.$versuffix ${libname}${release}.so.$major $libname.so'
  1027. soname_spec='${libname}${release}.so.$major'
  1028. finish_cmds='PATH="$PATH:/sbin" ldconfig -n $libdir'
  1029. shlibpath_var=LD_LIBRARY_PATH
  1030. if test -f /lib/ld.so.1; then
  1031. dynamic_linker='GNU ld.so'
  1032. else
  1033. # Only the GNU ld.so supports shared libraries on MkLinux.
  1034. case "$host_cpu" in
  1035. powerpc*) dynamic_linker=no ;;
  1036. *) dynamic_linker='Linux ld.so' ;;
  1037. esac
  1038. fi
  1039. ;;
  1040. netbsd* | openbsd*)
  1041. version_type=sunos
  1042. library_names_spec='${libname}${release}.so.$versuffix'
  1043. finish_cmds='PATH="$PATH:/sbin" ldconfig -m $libdir'
  1044. shlibpath_var=LD_LIBRARY_PATH
  1045. ;;
  1046. os2*)
  1047. libname_spec='$name'
  1048. library_names_spec='$libname.dll $libname.a'
  1049. dynamic_linker='OS/2 ld.exe'
  1050. shlibpath_var=LIBPATH
  1051. ;;
  1052. osf3* | osf4*)
  1053. version_type=osf
  1054. soname_spec='${libname}${release}.so'
  1055. library_names_spec='${libname}${release}.so.$versuffix $libname.so'
  1056. shlibpath_var=LD_LIBRARY_PATH
  1057. ;;
  1058. sco3.2v5*)
  1059. version_type=osf
  1060. soname_spec='${libname}${release}.so.$major'
  1061. library_names_spec='${libname}${release}.so.$versuffix ${libname}${release}.so.$major $libname.so'
  1062. shlibpath_var=LD_LIBRARY_PATH
  1063. ;;
  1064. solaris2*)
  1065. version_type=linux
  1066. library_names_spec='${libname}${release}.so.$versuffix ${libname}${release}.so.$major $libname.so'
  1067. soname_spec='${libname}${release}.so.$major'
  1068. shlibpath_var=LD_LIBRARY_PATH
  1069. ;;
  1070. sunos4*)
  1071. version_type=sunos
  1072. library_names_spec='${libname}${release}.so.$versuffix'
  1073. finish_cmds='PATH="$PATH:/usr/etc" ldconfig $libdir'
  1074. shlibpath_var=LD_LIBRARY_PATH
  1075. ;;
  1076. sysv4.2uw2*)
  1077. version_type=linux
  1078. library_names_spec='${libname}${release}.so.$versuffix ${libname}${release}.so.$major $libname.so'
  1079. soname_spec='${libname}${release}.so.$major'
  1080. shlibpath_var=LD_LIBRARY_PATH
  1081. ;;
  1082. uts4*)
  1083. version_type=linux
  1084. library_names_spec='${libname}${release}.so.$versuffix ${libname}${release}.so.$major $libname.so'
  1085. soname_spec='${libname}${release}.so.$major'
  1086. shlibpath_var=LD_LIBRARY_PATH
  1087. ;;
  1088. *)
  1089. dynamic_linker=no
  1090. ;;
  1091. esac
  1092. echo "$ac_t$dynamic_linker"
  1093. test "$dynamic_linker" = no && can_build_shared=no
  1094. # Report the final consequences.
  1095. echo "checking if libtool supports shared libraries... $can_build_shared" 1>&6
  1096. echo $ac_n "checking whether to build shared libraries... $ac_c" 1>&6
  1097. test "$can_build_shared" = "no" && enable_shared=no
  1098. # On AIX, shared libraries and static libraries use the same namespace, and
  1099. # are all built from PIC.
  1100. case "$host_os" in
  1101. aix*)
  1102. test "$enable_shared" = yes && enable_static=no
  1103. if test -n "$RANLIB"; then
  1104. archive_cmds="$archive_cmds;\$RANLIB \$lib"
  1105. postinstall_cmds='$RANLIB $lib'
  1106. fi
  1107. ;;
  1108. esac
  1109. echo "$ac_t$enable_shared" 1>&6
  1110. # Make sure either enable_shared or enable_static is yes.
  1111. test "$enable_shared" = yes || enable_static=yes
  1112. echo "checking whether to build static libraries... $enable_static" 1>&6
  1113. echo $ac_n "checking for objdir... $ac_c" 1>&6
  1114. rm -f .libs 2>/dev/null
  1115. mkdir .libs 2>/dev/null
  1116. if test -d .libs; then
  1117. objdir=.libs
  1118. else
  1119. # MS-DOS does not allow filenames that begin with a dot.
  1120. objdir=_libs
  1121. fi
  1122. rmdir .libs 2>/dev/null
  1123. echo "$ac_t$objdir" 1>&6
  1124. # Copy echo and quote the copy, instead of the original, because it is
  1125. # used later.
  1126. ltecho="$echo"
  1127. # Now quote all the things that may contain metacharacters.
  1128. for var in ltecho old_CC old_CFLAGS old_CPPFLAGS old_LD old_NM old_RANLIB \
  1129. old_LN_S AR CC LD LN_S NM reload_flag reload_cmds wl pic_flag \
  1130. link_static_flag no_builtin_flag export_dynamic_flag_spec \
  1131. libname_spec library_names_spec soname_spec RANLIB \
  1132. old_archive_cmds old_archive_from_new_cmds old_postinstall_cmds \
  1133. old_postuninstall_cmds archive_cmds postinstall_cmds postuninstall_cmds \
  1134. allow_undefined_flag no_undefined_flag \
  1135. finish_cmds finish_eval global_symbol_pipe \
  1136. hardcode_libdir_flag_spec hardcode_libdir_separator; do
  1137. case "$var" in
  1138. reload_cmds | old_archive_cmds | old_archive_from_new_cmds | \
  1139. old_postinstall_cmds | old_postuninstall_cmds | archive_cmds | \
  1140. postinstall_cmds | postuninstall_cmds | finish_cmds)
  1141. # Double-quote double-evaled strings.
  1142. eval "$var=\`\$echo \"X\$$var\" | \$Xsed -e \"\$double_quote_subst\" -e \"\$sed_quote_subst\"\`"
  1143. ;;
  1144. *)
  1145. eval "$var=\`\$echo \"X\$$var\" | \$Xsed -e \"\$sed_quote_subst\"\`"
  1146. ;;
  1147. esac
  1148. done
  1149. ofile=libtool
  1150. trap "$rm $ofile; exit 1" 1 2 15
  1151. echo creating $ofile
  1152. $rm $ofile
  1153. cat <<EOF > $ofile
  1154. #! /bin/sh
  1155. # libtool - Provide generalized library-building support services.
  1156. # Generated automatically by $PROGRAM - GNU $PACKAGE $VERSION
  1157. # NOTE: Changes made to this file will be lost: look at ltconfig or ltmain.sh.
  1158. #
  1159. # Copyright (C) 1996-1998 Free Software Foundation, Inc.
  1160. # Gordon Matzigkeit <gord@gnu.ai.mit.edu>, 1996
  1161. #
  1162. # This program is free software; you can redistribute it and/or modify
  1163. # it under the terms of the GNU General Public License as published by
  1164. # the Free Software Foundation; either version 2 of the License, or
  1165. # (at your option) any later version.
  1166. #
  1167. # This program is distributed in the hope that it will be useful, but
  1168. # WITHOUT ANY WARRANTY; without even the implied warranty of
  1169. # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
  1170. # General Public License for more details.
  1171. #
  1172. # You should have received a copy of the GNU General Public License
  1173. # along with this program; if not, write to the Free Software
  1174. # Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
  1175. #
  1176. # As a special exception to the GNU General Public License, if you
  1177. # distribute this file as part of a program that contains a
  1178. # configuration script generated by Autoconf, you may include it under
  1179. # the same distribution terms that you use for the rest of that program.
  1180. # This program was configured as follows,
  1181. # on host `(hostname || uname -n) 2>/dev/null | sed 1q`:
  1182. #
  1183. # CC="$old_CC" CFLAGS="$old_CFLAGS" CPPFLAGS="$old_CPPFLAGS" \\
  1184. # LD="$old_LD" NM="$old_NM" RANLIB="$old_RANLIB" LN_S="$old_LN_S" \\
  1185. # $0$ltconfig_args
  1186. #
  1187. # Compiler and other test output produced by $progname, useful for
  1188. # debugging $progname, is in ./config.log if it exists.
  1189. # Sed that helps us avoid accidentally triggering echo(1) options like -n.
  1190. Xsed="sed -e s/^X//"
  1191. # The HP-UX ksh and POSIX shell print the target directory to stdout
  1192. # if CDPATH is set.
  1193. if test "\${CDPATH+set}" = set; then CDPATH=; export CDPATH; fi
  1194. # An echo program that does not interpret backslashes.
  1195. echo="$ltecho"
  1196. # The version of $progname that generated this script.
  1197. LTCONFIG_VERSION="$VERSION"
  1198. # Shell to use when invoking shell scripts.
  1199. SHELL=${CONFIG_SHELL-/bin/sh}
  1200. # Whether or not to build libtool libraries.
  1201. build_libtool_libs=$enable_shared
  1202. # Whether or not to build old-style libraries.
  1203. build_old_libs=$enable_static
  1204. # The host system.
  1205. host_alias="$host_alias"
  1206. host="$host"
  1207. # The archiver.
  1208. AR="$AR"
  1209. # The default C compiler.
  1210. CC="$CC"
  1211. # The linker used to build libraries.
  1212. LD="$LD"
  1213. # Whether we need hard or soft links.
  1214. LN_S="$LN_S"
  1215. # A BSD-compatible nm program.
  1216. NM="$NM"
  1217. # The name of the directory that contains temporary libtool files.
  1218. objdir="$objdir"
  1219. # How to create relocatable object files.
  1220. reload_flag="$reload_flag"
  1221. reload_cmds="$reload_cmds"
  1222. # How to pass a linker flag through the compiler.
  1223. wl="$wl"
  1224. # Additional compiler flags for building library objects.
  1225. pic_flag="$pic_flag"
  1226. # Compiler flag to prevent dynamic linking.
  1227. link_static_flag="$link_static_flag"
  1228. # Compiler flag to turn off builtin functions.
  1229. no_builtin_flag="$no_builtin_flag"
  1230. # Compiler flag to allow reflexive dlopens.
  1231. export_dynamic_flag_spec="$export_dynamic_flag_spec"
  1232. # Library versioning type.
  1233. version_type=$version_type
  1234. # Format of library name prefix.
  1235. libname_spec="$libname_spec"
  1236. # List of archive names. First name is the real one, the rest are links.
  1237. # The last name is the one that the linker finds with -lNAME.
  1238. library_names_spec="$library_names_spec"
  1239. # The coded name of the library, if different from the real name.
  1240. soname_spec="$soname_spec"
  1241. # Commands used to build and install an old-style archive.
  1242. RANLIB="$RANLIB"
  1243. old_archive_cmds="$old_archive_cmds"
  1244. old_postinstall_cmds="$old_postinstall_cmds"
  1245. old_postuninstall_cmds="$old_postuninstall_cmds"
  1246. # Create an old-style archive from a shared archive.
  1247. old_archive_from_new_cmds="$old_archive_from_new_cmds"
  1248. # Commands used to build and install a shared archive.
  1249. archive_cmds="$archive_cmds"
  1250. postinstall_cmds="$postinstall_cmds"
  1251. postuninstall_cmds="$postuninstall_cmds"
  1252. # Flag that allows shared libraries with undefined symbols to be built.
  1253. allow_undefined_flag="$allow_undefined_flag"
  1254. # Flag that forces no undefined symbols.
  1255. no_undefined_flag="$no_undefined_flag"
  1256. # Commands used to finish a libtool library installation in a directory.
  1257. finish_cmds="$finish_cmds"
  1258. # Same as above, but a single script fragment to be evaled but not shown.
  1259. finish_eval="$finish_eval"
  1260. # Take the output of nm and produce a listing of raw symbols and C names.
  1261. global_symbol_pipe="$global_symbol_pipe"
  1262. # This is the shared library runtime path variable.
  1263. runpath_var=$runpath_var
  1264. # This is the shared library path variable.
  1265. shlibpath_var=$shlibpath_var
  1266. # How to hardcode a shared library path into an executable.
  1267. hardcode_action=$hardcode_action
  1268. # Flag to hardcode \$libdir into a binary during linking.
  1269. # This must work even if \$libdir does not exist.
  1270. hardcode_libdir_flag_spec="$hardcode_libdir_flag_spec"
  1271. # Whether we need a single -rpath flag with a separated argument.
  1272. hardcode_libdir_separator="$hardcode_libdir_separator"
  1273. # Set to yes if using DIR/libNAME.so during linking hardcodes DIR into the
  1274. # resulting binary.
  1275. hardcode_direct=$hardcode_direct
  1276. # Set to yes if using the -LDIR flag during linking hardcodes DIR into the
  1277. # resulting binary.
  1278. hardcode_minus_L=$hardcode_minus_L
  1279. # Set to yes if using SHLIBPATH_VAR=DIR during linking hardcodes DIR into
  1280. # the resulting binary.
  1281. hardcode_shlibpath_var=$hardcode_shlibpath_var
  1282. EOF
  1283. case "$host_os" in
  1284. aix3*)
  1285. cat <<\EOF >> $ofile
  1286. # AIX sometimes has problems with the GCC collect2 program. For some
  1287. # reason, if we set the COLLECT_NAMES environment variable, the problems
  1288. # vanish in a puff of smoke.
  1289. if test "${COLLECT_NAMES+set}" != set; then
  1290. COLLECT_NAMES=
  1291. export COLLECT_NAMES
  1292. fi
  1293. EOF
  1294. ;;
  1295. esac
  1296. # Append the ltmain.sh script.
  1297. cat "$ltmain" >> $ofile || (rm -f $ofile; exit 1)
  1298. chmod +x $ofile
  1299. exit 0
  1300. # Local Variables:
  1301. # mode:shell-script
  1302. # sh-indentation:2
  1303. # End: