PageRenderTime 69ms CodeModel.GetById 26ms RepoModel.GetById 0ms app.codeStats 1ms

/exult/tags/Release0_25/ltmain.sh

#
Shell | 2473 lines | 2134 code | 150 blank | 189 comment | 242 complexity | 05762fefae46390174c1a8cf96f71fb6 MD5 | raw file
Possible License(s): GPL-2.0
  1. # ltmain.sh - Provide generalized library-building support services.
  2. # NOTE: Changing this file will not affect anything until you rerun ltconfig.
  3. #
  4. # Copyright (C) 1996-2000 Free Software Foundation, Inc.
  5. # Originally by Gordon Matzigkeit <gord@gnu.ai.mit.edu>, 1996
  6. #
  7. # This program is free software; you can redistribute it and/or modify
  8. # it under the terms of the GNU General Public License as published by
  9. # the Free Software Foundation; either version 2 of the License, or
  10. # (at your option) any later version.
  11. #
  12. # This program is distributed in the hope that it will be useful, but
  13. # WITHOUT ANY WARRANTY; without even the implied warranty of
  14. # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
  15. # General Public License for more details.
  16. #
  17. # You should have received a copy of the GNU General Public License
  18. # along with this program; if not, write to the Free Software
  19. # Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
  20. #
  21. # As a special exception to the GNU General Public License, if you
  22. # distribute this file as part of a program that contains a
  23. # configuration script generated by Autoconf, you may include it under
  24. # the same distribution terms that you use for the rest of that program.
  25. # Check that we have a working $echo.
  26. if test "X$1" = X--no-reexec; then
  27. # Discard the --no-reexec flag, and continue.
  28. shift
  29. elif test "X$1" = X--fallback-echo; then
  30. # Avoid inline document here, it may be left over
  31. :
  32. elif test "X`($echo '\t') 2>/dev/null`" = 'X\t'; then
  33. # Yippee, $echo works!
  34. :
  35. else
  36. # Restart under the correct shell, and then maybe $echo will work.
  37. exec $SHELL "$0" --no-reexec ${1+"$@"}
  38. fi
  39. if test "X$1" = X--fallback-echo; then
  40. # used as fallback echo
  41. shift
  42. cat <<EOF
  43. $*
  44. EOF
  45. exit 0
  46. fi
  47. # The name of this program.
  48. progname=`$echo "$0" | sed 's%^.*/%%'`
  49. modename="$progname"
  50. # Constants.
  51. PROGRAM=ltmain.sh
  52. PACKAGE=libtool
  53. VERSION=1.3c
  54. TIMESTAMP=" (1.662 2000/01/13 00:52:59)"
  55. default_mode=
  56. help="Try \`$progname --help' for more information."
  57. magic="%%%MAGIC variable%%%"
  58. mkdir="mkdir"
  59. mv="mv -f"
  60. rm="rm -f"
  61. # Sed substitution that helps us do robust quoting. It backslashifies
  62. # metacharacters that are still active within double-quoted strings.
  63. Xsed='sed -e 1s/^X//'
  64. sed_quote_subst='s/\([\\`\\"$\\\\]\)/\\\1/g'
  65. SP2NL='tr \040 \012'
  66. NL2SP='tr \015\012 \040\040'
  67. # NLS nuisances.
  68. # Only set LANG and LC_ALL to C if already set.
  69. # These must not be set unconditionally because not all systems understand
  70. # e.g. LANG=C (notably SCO).
  71. # We save the old values to restore during execute mode.
  72. if test "${LC_ALL+set}" = set; then
  73. save_LC_ALL="$LC_ALL"; LC_ALL=C; export LC_ALL
  74. fi
  75. if test "${LANG+set}" = set; then
  76. save_LANG="$LANG"; LANG=C; export LANG
  77. fi
  78. if test "$LTCONFIG_VERSION" != "$VERSION"; then
  79. echo "$modename: ltconfig version \`$LTCONFIG_VERSION' does not match $PROGRAM version \`$VERSION'" 1>&2
  80. echo "Fatal configuration error. See the $PACKAGE docs for more information." 1>&2
  81. exit 1
  82. fi
  83. if test "$build_libtool_libs" != yes && test "$build_old_libs" != yes; then
  84. echo "$modename: not configured to build any kind of library" 1>&2
  85. echo "Fatal configuration error. See the $PACKAGE docs for more information." 1>&2
  86. exit 1
  87. fi
  88. # Global variables.
  89. mode=$default_mode
  90. nonopt=
  91. prev=
  92. prevopt=
  93. run=
  94. show="$echo"
  95. show_help=
  96. execute_dlfiles=
  97. lo2o="s/\\.lo\$/.${objext}/"
  98. o2lo="s/\\.${objext}\$/.lo/"
  99. # Parse our command line options once, thoroughly.
  100. while test $# -gt 0
  101. do
  102. arg="$1"
  103. shift
  104. case "$arg" in
  105. -*=*) optarg=`$echo "X$arg" | $Xsed -e 's/[-_a-zA-Z0-9]*=//'` ;;
  106. *) optarg= ;;
  107. esac
  108. # If the previous option needs an argument, assign it.
  109. if test -n "$prev"; then
  110. case "$prev" in
  111. execute_dlfiles)
  112. eval "$prev=\"\$$prev \$arg\""
  113. ;;
  114. *)
  115. eval "$prev=\$arg"
  116. ;;
  117. esac
  118. prev=
  119. prevopt=
  120. continue
  121. fi
  122. # Have we seen a non-optional argument yet?
  123. case "$arg" in
  124. --help)
  125. show_help=yes
  126. ;;
  127. --version)
  128. echo "$PROGRAM (GNU $PACKAGE) $VERSION$TIMESTAMP"
  129. exit 0
  130. ;;
  131. --config)
  132. sed -e '1,/^### BEGIN LIBTOOL CONFIG/d' -e '/^### END LIBTOOL CONFIG/,$d' $0
  133. exit 0
  134. ;;
  135. --debug)
  136. echo "$progname: enabling shell trace mode"
  137. set -x
  138. ;;
  139. --dry-run | -n)
  140. run=:
  141. ;;
  142. --features)
  143. echo "host: $host"
  144. if test "$build_libtool_libs" = yes; then
  145. echo "enable shared libraries"
  146. else
  147. echo "disable shared libraries"
  148. fi
  149. if test "$build_old_libs" = yes; then
  150. echo "enable static libraries"
  151. else
  152. echo "disable static libraries"
  153. fi
  154. exit 0
  155. ;;
  156. --finish) mode="finish" ;;
  157. --mode) prevopt="--mode" prev=mode ;;
  158. --mode=*) mode="$optarg" ;;
  159. --quiet | --silent)
  160. show=:
  161. ;;
  162. -dlopen)
  163. prevopt="-dlopen"
  164. prev=execute_dlfiles
  165. ;;
  166. -*)
  167. $echo "$modename: unrecognized option \`$arg'" 1>&2
  168. $echo "$help" 1>&2
  169. exit 1
  170. ;;
  171. *)
  172. nonopt="$arg"
  173. break
  174. ;;
  175. esac
  176. done
  177. if test -n "$prevopt"; then
  178. $echo "$modename: option \`$prevopt' requires an argument" 1>&2
  179. $echo "$help" 1>&2
  180. exit 1
  181. fi
  182. if test -z "$show_help"; then
  183. # Infer the operation mode.
  184. if test -z "$mode"; then
  185. case "$nonopt" in
  186. *cc | *++ | gcc* | *-gcc*)
  187. mode=link
  188. for arg
  189. do
  190. case "$arg" in
  191. -c)
  192. mode=compile
  193. break
  194. ;;
  195. esac
  196. done
  197. ;;
  198. *db | *dbx | *strace | *truss)
  199. mode=execute
  200. ;;
  201. *install*|cp|mv)
  202. mode=install
  203. ;;
  204. *rm)
  205. mode=uninstall
  206. ;;
  207. *)
  208. # If we have no mode, but dlfiles were specified, then do execute mode.
  209. test -n "$execute_dlfiles" && mode=execute
  210. # Just use the default operation mode.
  211. if test -z "$mode"; then
  212. if test -n "$nonopt"; then
  213. $echo "$modename: warning: cannot infer operation mode from \`$nonopt'" 1>&2
  214. else
  215. $echo "$modename: warning: cannot infer operation mode without MODE-ARGS" 1>&2
  216. fi
  217. fi
  218. ;;
  219. esac
  220. fi
  221. # Only execute mode is allowed to have -dlopen flags.
  222. if test -n "$execute_dlfiles" && test "$mode" != execute; then
  223. $echo "$modename: unrecognized option \`-dlopen'" 1>&2
  224. $echo "$help" 1>&2
  225. exit 1
  226. fi
  227. # Change the help message to a mode-specific one.
  228. generic_help="$help"
  229. help="Try \`$modename --help --mode=$mode' for more information."
  230. # These modes are in order of execution frequency so that they run quickly.
  231. case "$mode" in
  232. # libtool compile mode
  233. compile)
  234. modename="$modename: compile"
  235. # Get the compilation command and the source file.
  236. base_compile=
  237. prev=
  238. lastarg=
  239. srcfile="$nonopt"
  240. suppress_output=
  241. user_target=no
  242. for arg
  243. do
  244. case "$prev" in
  245. "") ;;
  246. xcompiler)
  247. # Aesthetically quote the previous argument.
  248. prev=
  249. lastarg=`$echo "X$arg" | $Xsed -e "$sed_quote_subst"`
  250. case "$arg" in
  251. # Double-quote args containing other shell metacharacters.
  252. # Many Bourne shells cannot handle close brackets correctly
  253. # in scan sets, so we specify it separately.
  254. *[\[\~\#\^\&\*\(\)\{\}\|\;\<\>\?\'\ \ ]*|*]*|"")
  255. arg="\"$arg\""
  256. ;;
  257. esac
  258. # Add the previous argument to base_compile.
  259. if test -z "$base_compile"; then
  260. base_compile="$lastarg"
  261. else
  262. base_compile="$base_compile $lastarg"
  263. fi
  264. continue
  265. ;;
  266. esac
  267. # Accept any command-line options.
  268. case "$arg" in
  269. -o)
  270. if test "$user_target" != "no"; then
  271. $echo "$modename: you cannot specify \`-o' more than once" 1>&2
  272. exit 1
  273. fi
  274. user_target=next
  275. ;;
  276. -static)
  277. build_old_libs=yes
  278. continue
  279. ;;
  280. -Xcompiler)
  281. prev=xcompiler
  282. continue
  283. ;;
  284. -Wc,*)
  285. args=`$echo "X$arg" | $Xsed -e "s/^-Wc,//"`
  286. lastarg=
  287. IFS="${IFS= }"; save_ifs="$IFS"; IFS=','
  288. for arg in $args; do
  289. IFS="$save_ifs"
  290. # Double-quote args containing other shell metacharacters.
  291. # Many Bourne shells cannot handle close brackets correctly
  292. # in scan sets, so we specify it separately.
  293. case "$arg" in
  294. *[\[\~\#\^\&\*\(\)\{\}\|\;\<\>\?\'\ \ ]*|*]*|"")
  295. arg="\"$arg\""
  296. ;;
  297. esac
  298. lastarg="$lastarg $arg"
  299. done
  300. IFS="$save_ifs"
  301. lastarg=`$echo "X$lastarg" | $Xsed -e "s/^ //"`
  302. # Add the arguments to base_compile.
  303. if test -z "$base_compile"; then
  304. base_compile="$lastarg"
  305. else
  306. base_compile="$base_compile $lastarg"
  307. fi
  308. continue
  309. ;;
  310. esac
  311. case "$user_target" in
  312. next)
  313. # The next one is the -o target name
  314. user_target=yes
  315. continue
  316. ;;
  317. yes)
  318. # We got the output file
  319. user_target=set
  320. libobj="$arg"
  321. continue
  322. ;;
  323. esac
  324. # Accept the current argument as the source file.
  325. lastarg="$srcfile"
  326. srcfile="$arg"
  327. # Aesthetically quote the previous argument.
  328. # Backslashify any backslashes, double quotes, and dollar signs.
  329. # These are the only characters that are still specially
  330. # interpreted inside of double-quoted scrings.
  331. lastarg=`$echo "X$lastarg" | $Xsed -e "$sed_quote_subst"`
  332. # Double-quote args containing other shell metacharacters.
  333. # Many Bourne shells cannot handle close brackets correctly
  334. # in scan sets, so we specify it separately.
  335. case "$lastarg" in
  336. *[\[\~\#\^\&\*\(\)\{\}\|\;\<\>\?\'\ \ ]*|*]*|"")
  337. lastarg="\"$lastarg\""
  338. ;;
  339. esac
  340. # Add the previous argument to base_compile.
  341. if test -z "$base_compile"; then
  342. base_compile="$lastarg"
  343. else
  344. base_compile="$base_compile $lastarg"
  345. fi
  346. done
  347. case "$user_target" in
  348. set)
  349. ;;
  350. no)
  351. # Get the name of the library object.
  352. libobj=`$echo "X$srcfile" | $Xsed -e 's%^.*/%%'`
  353. ;;
  354. *)
  355. $echo "$modename: you must specify a target with \`-o'" 1>&2
  356. exit 1
  357. ;;
  358. esac
  359. # Recognize several different file suffixes.
  360. # If the user specifies -o file.o, it is replaced with file.lo
  361. xform='[cCFSfmso]'
  362. case "$libobj" in
  363. *.ada) xform=ada ;;
  364. *.adb) xform=adb ;;
  365. *.ads) xform=ads ;;
  366. *.asm) xform=asm ;;
  367. *.c++) xform=c++ ;;
  368. *.cc) xform=cc ;;
  369. *.cpp) xform=cpp ;;
  370. *.cxx) xform=cxx ;;
  371. *.f90) xform=f90 ;;
  372. *.for) xform=for ;;
  373. esac
  374. libobj=`$echo "X$libobj" | $Xsed -e "s/\.$xform$/.lo/"`
  375. case "$libobj" in
  376. *.lo) obj=`$echo "X$libobj" | $Xsed -e "$lo2o"` ;;
  377. *)
  378. $echo "$modename: cannot determine name of library object from \`$libobj'" 1>&2
  379. exit 1
  380. ;;
  381. esac
  382. if test -z "$base_compile"; then
  383. $echo "$modename: you must specify a compilation command" 1>&2
  384. $echo "$help" 1>&2
  385. exit 1
  386. fi
  387. # Delete any leftover library objects.
  388. if test "$build_old_libs" = yes; then
  389. removelist="$obj $libobj"
  390. else
  391. removelist="$libobj"
  392. fi
  393. $run $rm $removelist
  394. trap "$run $rm $removelist; exit 1" 1 2 15
  395. # Calculate the filename of the output object if compiler does
  396. # not support -o with -c
  397. if test "$compiler_c_o" = no; then
  398. output_obj=`$echo "X$srcfile" | $Xsed -e 's%^.*/%%' -e 's%\..*$%%'`.${objext}
  399. lockfile="$output_obj.lock"
  400. removelist="$removelist $output_obj $lockfile"
  401. trap "$run $rm $removelist; exit 1" 1 2 15
  402. else
  403. need_locks=no
  404. lockfile=
  405. fi
  406. # Lock this critical section if it is needed
  407. # We use this script file to make the link, it avoids creating a new file
  408. if test "$need_locks" = yes; then
  409. until ln "$0" "$lockfile" 2>/dev/null; do
  410. $show "Waiting for $lockfile to be removed"
  411. sleep 2
  412. done
  413. elif test "$need_locks" = warn; then
  414. if test -f "$lockfile"; then
  415. echo "\
  416. *** ERROR, $lockfile exists and contains:
  417. `cat $lockfile 2>/dev/null`
  418. This indicates that another process is trying to use the same
  419. temporary object file, and libtool could not work around it because
  420. your compiler does not support \`-c' and \`-o' together. If you
  421. repeat this compilation, it may succeed, by chance, but you had better
  422. avoid parallel builds (make -j) in this platform, or get a better
  423. compiler."
  424. $run $rm $removelist
  425. exit 1
  426. fi
  427. echo $srcfile > "$lockfile"
  428. fi
  429. if test -n "$fix_srcfile_path"; then
  430. eval srcfile=\"$fix_srcfile_path\"
  431. fi
  432. # Only build a PIC object if we are building libtool libraries.
  433. if test "$build_libtool_libs" = yes; then
  434. # Without this assignment, base_compile gets emptied.
  435. fbsd_hideous_sh_bug=$base_compile
  436. if test "$pic_mode" != no; then
  437. # All platforms use -DPIC, to notify preprocessed assembler code.
  438. command="$base_compile $srcfile $pic_flag -DPIC"
  439. else
  440. # Don't build PIC code
  441. command="$base_compile $srcfile"
  442. fi
  443. if test "$build_old_libs" = yes; then
  444. lo_libobj="$libobj"
  445. dir=`$echo "X$libobj" | $Xsed -e 's%/[^/]*$%%'`
  446. if test "X$dir" = "X$libobj"; then
  447. dir="$objdir"
  448. else
  449. dir="$dir/$objdir"
  450. fi
  451. libobj="$dir/"`$echo "X$libobj" | $Xsed -e 's%^.*/%%'`
  452. if test -d "$dir"; then
  453. $show "$rm $libobj"
  454. $run $rm $libobj
  455. else
  456. $show "$mkdir $dir"
  457. $run $mkdir $dir
  458. status=$?
  459. if test $status -ne 0 && test ! -d $dir; then
  460. exit $status
  461. fi
  462. fi
  463. fi
  464. if test "$compiler_o_lo" = yes; then
  465. output_obj="$libobj"
  466. command="$command -o $output_obj"
  467. elif test "$compiler_c_o" = yes; then
  468. output_obj="$obj"
  469. command="$command -o $output_obj"
  470. fi
  471. $run $rm "$output_obj"
  472. $show "$command"
  473. if $run eval "$command"; then :
  474. else
  475. test -n "$output_obj" && $run $rm $removelist
  476. exit 1
  477. fi
  478. if test "$need_locks" = warn &&
  479. test x"`cat $lockfile 2>/dev/null`" != x"$srcfile"; then
  480. echo "\
  481. *** ERROR, $lockfile contains:
  482. `cat $lockfile 2>/dev/null`
  483. but it should contain:
  484. $srcfile
  485. This indicates that another process is trying to use the same
  486. temporary object file, and libtool could not work around it because
  487. your compiler does not support \`-c' and \`-o' together. If you
  488. repeat this compilation, it may succeed, by chance, but you had better
  489. avoid parallel builds (make -j) in this platform, or get a better
  490. compiler."
  491. $run $rm $removelist
  492. exit 1
  493. fi
  494. # Just move the object if needed, then go on to compile the next one
  495. if test x"$output_obj" != x"$libobj"; then
  496. $show "$mv $output_obj $libobj"
  497. if $run $mv $output_obj $libobj; then :
  498. else
  499. error=$?
  500. $run $rm $removelist
  501. exit $error
  502. fi
  503. fi
  504. # If we have no pic_flag, then copy the object into place and finish.
  505. if (test -z "$pic_flag" || test "$pic_mode" != default) &&
  506. test "$build_old_libs" = yes; then
  507. # Rename the .lo from within objdir to obj
  508. if test -f $obj; then
  509. $show $rm $obj
  510. $run $rm $obj
  511. fi
  512. $show "$mv $libobj $obj"
  513. if $run $mv $libobj $obj; then :
  514. else
  515. error=$?
  516. $run $rm $removelist
  517. exit $error
  518. fi
  519. xdir=`$echo "X$obj" | $Xsed -e 's%/[^/]*$%%'`
  520. if test "X$xdir" = "X$obj"; then
  521. xdir="."
  522. else
  523. xdir="$xdir"
  524. fi
  525. baseobj=`$echo "X$obj" | $Xsed -e "s%.*/%%"`
  526. libobj=`$echo "X$baseobj" | $Xsed -e "$o2lo"`
  527. # Now arrange that obj and lo_libobj become the same file
  528. $show "(cd $xdir && $LN_S $baseobj $libobj)"
  529. if $run eval '(cd $xdir && $LN_S $baseobj $libobj)'; then
  530. exit 0
  531. else
  532. error=$?
  533. $run $rm $removelist
  534. exit $error
  535. fi
  536. fi
  537. # Allow error messages only from the first compilation.
  538. suppress_output=' >/dev/null 2>&1'
  539. fi
  540. # Only build a position-dependent object if we build old libraries.
  541. if test "$build_old_libs" = yes; then
  542. if test "$pic_mode" != yes; then
  543. # Don't build PIC code
  544. command="$base_compile $srcfile"
  545. else
  546. # All platforms use -DPIC, to notify preprocessed assembler code.
  547. command="$base_compile $srcfile $pic_flag -DPIC"
  548. fi
  549. if test "$compiler_c_o" = yes; then
  550. command="$command -o $obj"
  551. output_obj="$obj"
  552. fi
  553. # Suppress compiler output if we already did a PIC compilation.
  554. command="$command$suppress_output"
  555. $run $rm "$output_obj"
  556. $show "$command"
  557. if $run eval "$command"; then :
  558. else
  559. $run $rm $removelist
  560. exit 1
  561. fi
  562. if test "$need_locks" = warn &&
  563. test x"`cat $lockfile 2>/dev/null`" != x"$srcfile"; then
  564. echo "\
  565. *** ERROR, $lockfile contains:
  566. `cat $lockfile 2>/dev/null`
  567. but it should contain:
  568. $srcfile
  569. This indicates that another process is trying to use the same
  570. temporary object file, and libtool could not work around it because
  571. your compiler does not support \`-c' and \`-o' together. If you
  572. repeat this compilation, it may succeed, by chance, but you had better
  573. avoid parallel builds (make -j) in this platform, or get a better
  574. compiler."
  575. $run $rm $removelist
  576. exit 1
  577. fi
  578. # Just move the object if needed
  579. if test x"$output_obj" != x"$obj"; then
  580. $show "$mv $output_obj $obj"
  581. if $run $mv $output_obj $obj; then :
  582. else
  583. error=$?
  584. $run $rm $removelist
  585. exit $error
  586. fi
  587. fi
  588. # Create an invalid libtool object if no PIC, so that we do not
  589. # accidentally link it into a program.
  590. if test "$build_libtool_libs" != yes; then
  591. $show "echo timestamp > $libobj"
  592. $run eval "echo timestamp > \$libobj" || exit $?
  593. else
  594. # Move the .lo from within objdir
  595. $show "$mv $libobj $lo_libobj"
  596. if $run $mv $libobj $lo_libobj; then :
  597. else
  598. error=$?
  599. $run $rm $removelist
  600. exit $error
  601. fi
  602. fi
  603. fi
  604. # Unlock the critical section if it was locked
  605. if test "$need_locks" != no; then
  606. $rm "$lockfile"
  607. fi
  608. exit 0
  609. ;;
  610. # libtool link mode
  611. link | relink)
  612. modename="$modename: link"
  613. case "$host" in
  614. *-*-cygwin* | *-*-mingw* | *-*-os2*)
  615. # It is impossible to link a dll without this setting, and
  616. # we shouldn't force the makefile maintainer to figure out
  617. # which system we are compiling for in order to pass an extra
  618. # flag for every libtool invokation.
  619. # allow_undefined=no
  620. # FIXME: Unfortunately, there are problems with the above when trying
  621. # to make a dll which has undefined symbols, in which case not
  622. # even a static library is built. For now, we need to specify
  623. # -no-undefined on the libtool link line when we can be certain
  624. # that all symbols are satisfied, otherwise we get a static library.
  625. allow_undefined=yes
  626. ;;
  627. *)
  628. allow_undefined=yes
  629. ;;
  630. esac
  631. libtool_args="$nonopt"
  632. compile_command="$nonopt"
  633. finalize_command="$nonopt"
  634. compile_rpath=
  635. finalize_rpath=
  636. compile_shlibpath=
  637. finalize_shlibpath=
  638. convenience=
  639. old_convenience=
  640. deplibs=
  641. old_deplibs=
  642. compiler_flags=
  643. linker_flags=
  644. dllsearchpath=
  645. lib_search_path=`pwd`
  646. avoid_version=no
  647. dlfiles=
  648. dlprefiles=
  649. dlself=no
  650. export_dynamic=no
  651. export_symbols=
  652. export_symbols_regex=
  653. generated=
  654. libobjs=
  655. ltlibs=
  656. module=no
  657. no_install=no
  658. objs=
  659. prefer_static_libs=no
  660. preload=no
  661. prev=
  662. prevarg=
  663. release=
  664. rpath=
  665. xrpath=
  666. perm_rpath=
  667. temp_rpath=
  668. thread_safe=no
  669. vinfo=
  670. # We need to know -static, to get the right output filenames.
  671. for arg
  672. do
  673. case "$arg" in
  674. -all-static | -static)
  675. if test "X$arg" = "X-all-static"; then
  676. if test "$build_libtool_libs" = yes && test -z "$link_static_flag"; then
  677. $echo "$modename: warning: complete static linking is impossible in this configuration" 1>&2
  678. fi
  679. if test -n "$link_static_flag"; then
  680. dlopen_self=$dlopen_self_static
  681. fi
  682. else
  683. if test -z "$pic_flag" && test -n "$link_static_flag"; then
  684. dlopen_self=$dlopen_self_static
  685. fi
  686. fi
  687. build_libtool_libs=no
  688. build_old_libs=yes
  689. prefer_static_libs=yes
  690. break
  691. ;;
  692. esac
  693. done
  694. # See if our shared archives depend on static archives.
  695. test -n "$old_archive_from_new_cmds" && build_old_libs=yes
  696. # Go through the arguments, transforming them on the way.
  697. while test $# -gt 0; do
  698. arg="$1"
  699. shift
  700. case "$arg" in
  701. *[\[\~\#\^\&\*\(\)\{\}\|\;\<\>\?\'\ \ ]*|*]*|"")
  702. qarg=\"`$echo "X$arg" | $Xsed -e "$sed_quote_subst"`\" ### testsuite: skip nested quoting test
  703. ;;
  704. *) qarg=$arg ;;
  705. esac
  706. libtool_args="$libtool_args $qarg"
  707. # If the previous option needs an argument, assign it.
  708. if test -n "$prev"; then
  709. case "$prev" in
  710. output)
  711. compile_command="$compile_command @OUTPUT@"
  712. finalize_command="$finalize_command @OUTPUT@"
  713. ;;
  714. esac
  715. case "$prev" in
  716. dlfiles|dlprefiles)
  717. if test "$preload" = no; then
  718. # Add the symbol object into the linking commands.
  719. compile_command="$compile_command @SYMFILE@"
  720. finalize_command="$finalize_command @SYMFILE@"
  721. preload=yes
  722. fi
  723. case "$arg" in
  724. *.la | *.lo) ;; # We handle these cases below.
  725. force)
  726. if test "$dlself" = no; then
  727. dlself=needless
  728. export_dynamic=yes
  729. fi
  730. prev=
  731. continue
  732. ;;
  733. self)
  734. if test "$prev" = dlprefiles; then
  735. dlself=yes
  736. elif test "$prev" = dlfiles && test "$dlopen_self" != yes; then
  737. dlself=yes
  738. else
  739. dlself=needless
  740. export_dynamic=yes
  741. fi
  742. prev=
  743. continue
  744. ;;
  745. *)
  746. if test "$prev" = dlfiles; then
  747. dlfiles="$dlfiles $arg"
  748. else
  749. dlprefiles="$dlprefiles $arg"
  750. fi
  751. prev=
  752. ;;
  753. esac
  754. ;;
  755. expsyms)
  756. export_symbols="$arg"
  757. if test ! -f "$arg"; then
  758. $echo "$modename: symbol file \`$arg' does not exist"
  759. exit 1
  760. fi
  761. prev=
  762. continue
  763. ;;
  764. expsyms_regex)
  765. export_symbols_regex="$arg"
  766. prev=
  767. continue
  768. ;;
  769. release)
  770. release="-$arg"
  771. prev=
  772. continue
  773. ;;
  774. rpath | xrpath)
  775. # We need an absolute path.
  776. case "$arg" in
  777. [\\/]* | [A-Za-z]:[\\/]*) ;;
  778. *)
  779. $echo "$modename: only absolute run-paths are allowed" 1>&2
  780. exit 1
  781. ;;
  782. esac
  783. if test "$prev" = rpath; then
  784. case "$rpath " in
  785. *" $arg "*) ;;
  786. *) rpath="$rpath $arg" ;;
  787. esac
  788. else
  789. case "$xrpath " in
  790. *" $arg "*) ;;
  791. *) xrpath="$xrpath $arg" ;;
  792. esac
  793. fi
  794. prev=
  795. continue
  796. ;;
  797. xcompiler)
  798. compiler_flags="$compiler_flags $qarg"
  799. prev=
  800. compile_command="$compile_command $qarg"
  801. finalize_command="$finalize_command $qarg"
  802. continue
  803. ;;
  804. xlinker)
  805. linker_flags="$linker_flags $qarg"
  806. compiler_flags="$compiler_flags $wl$qarg"
  807. prev=
  808. compile_command="$compile_command $wl$qarg"
  809. finalize_command="$finalize_command $wl$qarg"
  810. continue
  811. ;;
  812. *)
  813. eval "$prev=\"\$arg\""
  814. prev=
  815. continue
  816. ;;
  817. esac
  818. fi
  819. prevarg="$arg"
  820. case "$arg" in
  821. -all-static)
  822. if test -n "$link_static_flag"; then
  823. compile_command="$compile_command $link_static_flag"
  824. finalize_command="$finalize_command $link_static_flag"
  825. fi
  826. continue
  827. ;;
  828. -allow-undefined)
  829. # FIXME: remove this flag sometime in the future.
  830. $echo "$modename: \`-allow-undefined' is deprecated because it is the default" 1>&2
  831. continue
  832. ;;
  833. -avoid-version)
  834. avoid_version=yes
  835. continue
  836. ;;
  837. -dlopen)
  838. prev=dlfiles
  839. continue
  840. ;;
  841. -dlpreopen)
  842. prev=dlprefiles
  843. continue
  844. ;;
  845. -export-dynamic)
  846. export_dynamic=yes
  847. continue
  848. ;;
  849. -export-symbols | -export-symbols-regex)
  850. if test -n "$export_symbols" || test -n "$export_symbols_regex"; then
  851. $echo "$modename: not more than one -exported-symbols argument allowed"
  852. exit 1
  853. fi
  854. if test "X$arg" = "X-export-symbols"; then
  855. prev=expsyms
  856. else
  857. prev=expsyms_regex
  858. fi
  859. continue
  860. ;;
  861. -L*)
  862. dir=`$echo "X$arg" | $Xsed -e 's/^-L//'`
  863. # We need an absolute path.
  864. case "$dir" in
  865. [\\/]* | [A-Za-z]:[\\/]*) ;;
  866. *)
  867. absdir=`cd "$dir" && pwd`
  868. if test -z "$absdir"; then
  869. $echo "$modename: cannot determine absolute directory name of \`$dir'" 1>&2
  870. exit 1
  871. fi
  872. dir="$absdir"
  873. ;;
  874. esac
  875. case "$deplibs " in
  876. *" -L$dir "*) ;;
  877. *)
  878. deplibs="$deplibs -L$dir"
  879. lib_search_path="$lib_search_path $dir"
  880. ;;
  881. esac
  882. case "$host" in
  883. *-*-cygwin* | *-*-mingw* | *-*-os2*)
  884. case ":$dllsearchpath:" in
  885. *":$dir:"*) ;;
  886. *) dllsearchpath="$dllsearchpath:$dir";;
  887. esac
  888. ;;
  889. esac
  890. continue
  891. ;;
  892. -l*)
  893. if test "$arg" = "-lc"; then
  894. case "$host" in
  895. *-*-cygwin* | *-*-mingw* | *-*-os2* | *-*-beos*)
  896. # These systems don't actually have c library (as such)
  897. continue
  898. ;;
  899. esac
  900. elif test "$arg" = "-lm"; then
  901. case "$host" in
  902. *-*-cygwin* | *-*-beos*)
  903. # These systems don't actually have math library (as such)
  904. continue
  905. ;;
  906. esac
  907. fi
  908. deplibs="$deplibs $arg"
  909. continue
  910. ;;
  911. -module)
  912. module=yes
  913. continue
  914. ;;
  915. -no-fast-install)
  916. fast_install=no
  917. continue
  918. ;;
  919. -no-install)
  920. case "$host" in
  921. *-*-cygwin* | *-*-mingw* | *-*-os2*)
  922. # The PATH hackery in wrapper scripts is required on Windows
  923. # in order for the loader to find any dlls it needs.
  924. $echo "$modename: warning: \`-no-install' is ignored for $host" 1>&2
  925. $echo "$modename: warning: assuming \`-no-fast-install' instead" 1>&2
  926. fast_install=no
  927. ;;
  928. *)
  929. no_install=yes
  930. ;;
  931. esac
  932. continue
  933. ;;
  934. -no-undefined)
  935. allow_undefined=no
  936. continue
  937. ;;
  938. -o) prev=output ;;
  939. -release)
  940. prev=release
  941. continue
  942. ;;
  943. -rpath)
  944. prev=rpath
  945. continue
  946. ;;
  947. -R)
  948. prev=xrpath
  949. continue
  950. ;;
  951. -R*)
  952. dir=`$echo "X$arg" | $Xsed -e 's/^-R//'`
  953. # We need an absolute path.
  954. case "$dir" in
  955. [\\/]* | [A-Za-z]:[\\/]*) ;;
  956. *)
  957. $echo "$modename: only absolute run-paths are allowed" 1>&2
  958. exit 1
  959. ;;
  960. esac
  961. case "$xrpath " in
  962. *" $dir "*) ;;
  963. *) xrpath="$xrpath $dir" ;;
  964. esac
  965. continue
  966. ;;
  967. -static)
  968. # If we have no pic_flag, then this is the same as -all-static.
  969. if test -z "$pic_flag" && test -n "$link_static_flag"; then
  970. compile_command="$compile_command $link_static_flag"
  971. finalize_command="$finalize_command $link_static_flag"
  972. fi
  973. continue
  974. ;;
  975. -thread-safe)
  976. thread_safe=yes
  977. continue
  978. ;;
  979. -version-info)
  980. prev=vinfo
  981. continue
  982. ;;
  983. -Wc,*)
  984. args=`$echo "X$arg" | $Xsed -e "$sed_quote_subst" -e 's/^-Wc,//'`
  985. arg=
  986. IFS="${IFS= }"; save_ifs="$IFS"; IFS=','
  987. for flag in $args; do
  988. IFS="$save_ifs"
  989. case "$flag" in
  990. *[\[\~\#\^\&\*\(\)\{\}\|\;\<\>\?\'\ \ ]*|*]*|"")
  991. flag="\"$flag\""
  992. ;;
  993. esac
  994. arg="$arg $wl$flag"
  995. compiler_flags="$compiler_flags $flag"
  996. done
  997. IFS="$save_ifs"
  998. arg=`$echo "X$arg" | $Xsed -e "s/^ //"`
  999. ;;
  1000. -Wl,*)
  1001. args=`$echo "X$arg" | $Xsed -e "$sed_quote_subst" -e 's/^-Wl,//'`
  1002. arg=
  1003. IFS="${IFS= }"; save_ifs="$IFS"; IFS=','
  1004. for flag in $args; do
  1005. IFS="$save_ifs"
  1006. case "$flag" in
  1007. *[\[\~\#\^\&\*\(\)\{\}\|\;\<\>\?\'\ \ ]*|*]*|"")
  1008. flag="\"$flag\""
  1009. ;;
  1010. esac
  1011. arg="$arg $wl$flag"
  1012. compiler_flags="$compiler_flags $wl$flag"
  1013. linker_flags="$linker_flags $flag"
  1014. done
  1015. IFS="$save_ifs"
  1016. arg=`$echo "X$arg" | $Xsed -e "s/^ //"`
  1017. ;;
  1018. -Xcompiler)
  1019. prev=xcompiler
  1020. continue
  1021. ;;
  1022. -Xlinker)
  1023. prev=xlinker
  1024. continue
  1025. ;;
  1026. # Some other compiler flag.
  1027. -* | +*)
  1028. # Unknown arguments in both finalize_command and compile_command need
  1029. # to be aesthetically quoted because they are evaled later.
  1030. arg=`$echo "X$arg" | $Xsed -e "$sed_quote_subst"`
  1031. case "$arg" in
  1032. *[\[\~\#\^\&\*\(\)\{\}\|\;\<\>\?\'\ \ ]*|*]*|"")
  1033. arg="\"$arg\""
  1034. ;;
  1035. esac
  1036. ;;
  1037. *.o | *.obj)
  1038. # A standard object.
  1039. objs="$objs $arg"
  1040. ;;
  1041. *.lo)
  1042. # A library object.
  1043. if test "$prev" = dlfiles; then
  1044. dlfiles="$dlfiles $arg"
  1045. if test "$build_libtool_libs" = yes && test "$dlopen" = yes; then
  1046. prev=
  1047. continue
  1048. else
  1049. # If libtool objects are unsupported, then we need to preload.
  1050. prev=dlprefiles
  1051. fi
  1052. fi
  1053. if test "$prev" = dlprefiles; then
  1054. # Preload the old-style object.
  1055. dlprefiles="$dlprefiles "`$echo "X$arg" | $Xsed -e "$lo2o"`
  1056. prev=
  1057. fi
  1058. libobjs="$libobjs $arg"
  1059. ;;
  1060. *.a | *.lib)
  1061. # An archive.
  1062. deplibs="$deplibs $arg"
  1063. old_deplibs="$old_deplibs $arg"
  1064. continue
  1065. ;;
  1066. *.la)
  1067. # A libtool-controlled library.
  1068. dlname=
  1069. libdir=
  1070. library_names=
  1071. old_library=
  1072. # Check to see that this really is a libtool archive.
  1073. if (sed -e '2q' $arg | egrep "^# Generated by .*$PACKAGE") >/dev/null 2>&1; then :
  1074. else
  1075. $echo "$modename: \`$arg' is not a valid libtool archive" 1>&2
  1076. exit 1
  1077. fi
  1078. # If the library was installed with an old release of libtool,
  1079. # it will not redefine variable installed.
  1080. installed=yes
  1081. # Read the .la file
  1082. # If there is no directory component, then add one.
  1083. case "$arg" in
  1084. */* | *\\*) . $arg ;;
  1085. *) . ./$arg ;;
  1086. esac
  1087. # Get the name of the library we link against.
  1088. linklib=
  1089. for l in $old_library $library_names; do
  1090. linklib="$l"
  1091. done
  1092. if test -z "$linklib"; then
  1093. $echo "$modename: cannot find name of link library for \`$arg'" 1>&2
  1094. exit 1
  1095. fi
  1096. if test "X$installed" = Xyes; then
  1097. dir="$libdir"
  1098. else
  1099. dir=`$echo "X$arg" | $Xsed -e 's%/[^/]*$%%'`
  1100. if test "X$dir" = "X$arg"; then
  1101. dir="$objdir"
  1102. else
  1103. dir="$dir/$objdir"
  1104. fi
  1105. fi
  1106. # This library was specified with -dlopen.
  1107. if test "$prev" = dlfiles; then
  1108. dlfiles="$dlfiles $arg"
  1109. if test -z "$dlname" || test "$dlopen" != yes || test "$build_libtool_libs" = no; then
  1110. # If there is no dlname, no dlopen support or we're linking statically,
  1111. # we need to preload.
  1112. prev=dlprefiles
  1113. else
  1114. # We should not create a dependency on this library
  1115. prev=
  1116. continue
  1117. fi
  1118. fi
  1119. # The library was specified with -dlpreopen.
  1120. if test "$prev" = dlprefiles; then
  1121. # Prefer using a static library (so that no silly _DYNAMIC symbols
  1122. # are required to link).
  1123. if test -n "$old_library"; then
  1124. dlprefiles="$dlprefiles $dir/$old_library"
  1125. else
  1126. dlprefiles="$dlprefiles $dir/$linklib"
  1127. fi
  1128. prev=
  1129. fi
  1130. deplibs="$deplibs $arg"
  1131. continue
  1132. ;;
  1133. # Some other compiler argument.
  1134. *)
  1135. # Unknown arguments in both finalize_command and compile_command need
  1136. # to be aesthetically quoted because they are evaled later.
  1137. arg=`$echo "X$arg" | $Xsed -e "$sed_quote_subst"`
  1138. case "$arg" in
  1139. *[\[\~\#\^\&\*\(\)\{\}\|\;\<\>\?\'\ \ ]*|*]*|"")
  1140. arg="\"$arg\""
  1141. ;;
  1142. esac
  1143. ;;
  1144. esac
  1145. # Now actually substitute the argument into the commands.
  1146. if test -n "$arg"; then
  1147. compile_command="$compile_command $arg"
  1148. finalize_command="$finalize_command $arg"
  1149. fi
  1150. done
  1151. if test -n "$prev"; then
  1152. $echo "$modename: the \`$prevarg' option requires an argument" 1>&2
  1153. $echo "$help" 1>&2
  1154. exit 1
  1155. fi
  1156. if test "$export_dynamic" = yes && test -n "$export_dynamic_flag_spec"; then
  1157. eval arg=\"$export_dynamic_flag_spec\"
  1158. compile_command="$compile_command $arg"
  1159. finalize_command="$finalize_command $arg"
  1160. fi
  1161. oldlibs=
  1162. # calculate the name of the file, without its directory
  1163. outputname=`$echo "X$output" | $Xsed -e 's%^.*/%%'`
  1164. libobjs_save="$libobjs"
  1165. if test -n "$shlibpath_var"; then
  1166. # get the directories listed in $shlibpath_var
  1167. eval shlib_search_path=\`\$echo \"X \${$shlibpath_var}\" \| \$Xsed -e \'s/:/ /g\'\`
  1168. else
  1169. shlib_search_path=
  1170. fi
  1171. eval sys_lib_search_path=\"$sys_lib_search_path_spec\"
  1172. eval sys_lib_dlsearch_path=\"$sys_lib_dlsearch_path_spec\"
  1173. lib_search_path="$lib_search_path $sys_lib_search_path $shlib_search_path"
  1174. case "$output" in
  1175. "")
  1176. $echo "$modename: you must specify an output file" 1>&2
  1177. $echo "$help" 1>&2
  1178. exit 1
  1179. ;;
  1180. *.a | *.lib)
  1181. linkmode=oldlib ;;
  1182. *.lo | *.o | *.obj)
  1183. linkmode=obj ;;
  1184. *.la)
  1185. linkmode=lib ;;
  1186. *) # Anything else should be a program.
  1187. linkmode=prog ;;
  1188. esac
  1189. output_objdir=`$echo "X$output" | $Xsed -e 's%/[^/]*$%%'`
  1190. if test "X$output_objdir" = "X$output"; then
  1191. output_objdir="$objdir"
  1192. else
  1193. output_objdir="$output_objdir/$objdir"
  1194. fi
  1195. # Create the object directory.
  1196. if test ! -d $output_objdir; then
  1197. $show "$mkdir $output_objdir"
  1198. $run $mkdir $output_objdir
  1199. status=$?
  1200. if test $status -ne 0 && test ! -d $output_objdir; then
  1201. exit $status
  1202. fi
  1203. fi
  1204. if test $linkmode != lib && test $linkmode != prog; then
  1205. # Find libtool convenience libraries
  1206. for deplib in $deplibs; do
  1207. case "$deplib" in
  1208. -l* | -L*)
  1209. $echo "$modename: warning: \`-l' and \`-L' are ignored for archives/objects" 1>&2
  1210. continue
  1211. ;;
  1212. esac
  1213. if test -f "$deplib"; then :
  1214. else
  1215. $echo "$modename: cannot find the library \`$deplib'" 1>&2
  1216. exit 1
  1217. fi
  1218. libdir=
  1219. old_library=
  1220. # Check to see that this really is a libtool archive.
  1221. if (sed -e '2q' $deplib | egrep "^# Generated by .*$PACKAGE") >/dev/null 2>&1; then :
  1222. else
  1223. $echo "$modename: \`$deplib' is not a valid libtool archive" 1>&2
  1224. exit 1
  1225. fi
  1226. ladir=`$echo "X$deplib" | $Xsed -e 's%/[^/]*$%%'`
  1227. test "X$ladir" = "X$deplib" && ladir="."
  1228. # Read the .la file
  1229. case "$deplib" in
  1230. */* | *\\*) . $deplib ;;
  1231. *) . ./$deplib ;;
  1232. esac
  1233. if test -z "$old_library"; then
  1234. $echo "$modename: cannot find name of link library for \`$deplib'" 1>&2
  1235. exit 1
  1236. fi
  1237. if test -n "$libdir"; then
  1238. $echo "$modename: \`$deplib' is not a convenience library" 1>&2
  1239. exit 1
  1240. fi
  1241. # It is a libtool convenience library, so add in its objects.
  1242. convenience="$convenience $ladir/$objdir/$old_library"
  1243. old_convenience="$old_convenience $ladir/$objdir/$old_library"
  1244. done
  1245. fi
  1246. case "$linkmode" in
  1247. oldlib)
  1248. if test -n "$deplibs"; then
  1249. $echo "$modename: warning: \`-l' and \`-L' are ignored for archives" 1>&2
  1250. fi
  1251. if test -n "$dlfiles$dlprefiles" || test "$dlself" != no; then
  1252. $echo "$modename: warning: \`-dlopen' is ignored for archives" 1>&2
  1253. fi
  1254. if test -n "$rpath"; then
  1255. $echo "$modename: warning: \`-rpath' is ignored for archives" 1>&2
  1256. fi
  1257. if test -n "$xrpath"; then
  1258. $echo "$modename: warning: \`-R' is ignored for archives" 1>&2
  1259. fi
  1260. if test -n "$vinfo"; then
  1261. $echo "$modename: warning: \`-version-info' is ignored for archives" 1>&2
  1262. fi
  1263. if test -n "$release"; then
  1264. $echo "$modename: warning: \`-release' is ignored for archives" 1>&2
  1265. fi
  1266. if test -n "$export_symbols" || test -n "$export_symbols_regex"; then
  1267. $echo "$modename: warning: \`-export-symbols' is ignored for archives" 1>&2
  1268. fi
  1269. # Now set the variables for building old libraries.
  1270. build_libtool_libs=no
  1271. oldlibs="$output"
  1272. objs="$objs$old_deplibs"
  1273. ;;
  1274. lib)
  1275. # Make sure we only generate libraries of the form `libNAME.la'.
  1276. case "$outputname" in
  1277. lib*)
  1278. name=`$echo "X$outputname" | $Xsed -e 's/\.la$//' -e 's/^lib//'`
  1279. eval libname=\"$libname_spec\"
  1280. ;;
  1281. *)
  1282. if test "$module" = no; then
  1283. $echo "$modename: libtool library \`$output' must begin with \`lib'" 1>&2
  1284. $echo "$help" 1>&2
  1285. exit 1
  1286. fi
  1287. if test "$need_lib_prefix" != no; then
  1288. # Add the "lib" prefix for modules if required
  1289. name=`$echo "X$outputname" | $Xsed -e 's/\.la$//'`
  1290. eval libname=\"$libname_spec\"
  1291. else
  1292. libname=`$echo "X$outputname" | $Xsed -e 's/\.la$//'`
  1293. fi
  1294. ;;
  1295. esac
  1296. if test -n "$objs$old_deplibs"; then
  1297. $echo "$modename: cannot build libtool library \`$output' from non-libtool objects:$objs" 2>&1
  1298. exit 1
  1299. fi
  1300. if test -n "$dlfiles$dlprefiles" || test "$dlself" != no; then
  1301. $echo "$modename: warning: \`-dlopen' is ignored for libtool libraries" 1>&2
  1302. fi
  1303. set dummy $rpath
  1304. if test $# -gt 2; then
  1305. $echo "$modename: warning: ignoring multiple \`-rpath's for a libtool library" 1>&2
  1306. fi
  1307. install_libdir="$2"
  1308. oldlibs=
  1309. if test -z "$rpath"; then
  1310. if test "$build_libtool_libs" = yes; then
  1311. # Building a libtool convenience library.
  1312. libext=al
  1313. oldlibs="$output_objdir/$libname.$libext $oldlibs"
  1314. build_libtool_libs=convenience
  1315. build_old_libs=yes
  1316. fi
  1317. if test -n "$vinfo"; then
  1318. $echo "$modename: warning: \`-version-info' is ignored for convenience libraries" 1>&2
  1319. fi
  1320. if test -n "$release"; then
  1321. $echo "$modename: warning: \`-release' is ignored for convenience libraries" 1>&2
  1322. fi
  1323. else
  1324. # Parse the version information argument.
  1325. IFS="${IFS= }"; save_ifs="$IFS"; IFS=':'
  1326. set dummy $vinfo 0 0 0
  1327. IFS="$save_ifs"
  1328. if test -n "$8"; then
  1329. $echo "$modename: too many parameters to \`-version-info'" 1>&2
  1330. $echo "$help" 1>&2
  1331. exit 1
  1332. fi
  1333. current="$2"
  1334. revision="$3"
  1335. age="$4"
  1336. # Check that each of the things are valid numbers.
  1337. case "$current" in
  1338. 0 | [1-9] | [1-9][0-9]*) ;;
  1339. *)
  1340. $echo "$modename: CURRENT \`$current' is not a nonnegative integer" 1>&2
  1341. $echo "$modename: \`$vinfo' is not valid version information" 1>&2
  1342. exit 1
  1343. ;;
  1344. esac
  1345. case "$revision" in
  1346. 0 | [1-9] | [1-9][0-9]*) ;;
  1347. *)
  1348. $echo "$modename: REVISION \`$revision' is not a nonnegative integer" 1>&2
  1349. $echo "$modename: \`$vinfo' is not valid version information" 1>&2
  1350. exit 1
  1351. ;;
  1352. esac
  1353. case "$age" in
  1354. 0 | [1-9] | [1-9][0-9]*) ;;
  1355. *)
  1356. $echo "$modename: AGE \`$age' is not a nonnegative integer" 1>&2
  1357. $echo "$modename: \`$vinfo' is not valid version information" 1>&2
  1358. exit 1
  1359. ;;
  1360. esac
  1361. if test $age -gt $current; then
  1362. $echo "$modename: AGE \`$age' is greater than the current interface number \`$current'" 1>&2
  1363. $echo "$modename: \`$vinfo' is not valid version information" 1>&2
  1364. exit 1
  1365. fi
  1366. # Calculate the version variables.
  1367. major=
  1368. versuffix=
  1369. verstring=
  1370. case "$version_type" in
  1371. none) ;;
  1372. irix)
  1373. major=`expr $current - $age + 1`
  1374. versuffix="$major.$revision"
  1375. verstring="sgi$major.$revision"
  1376. # Add in all the interfaces that we are compatible with.
  1377. loop=$revision
  1378. while test $loop != 0; do
  1379. iface=`expr $revision - $loop`
  1380. loop=`expr $loop - 1`
  1381. verstring="sgi$major.$iface:$verstring"
  1382. done
  1383. ;;
  1384. linux)
  1385. major=.`expr $current - $age`
  1386. versuffix="$major.$age.$revision"
  1387. ;;
  1388. osf)
  1389. major=`expr $current - $age`
  1390. versuffix=".$current.$age.$revision"
  1391. verstring="$current.$age.$revision"
  1392. # Add in all the interfaces that we are compatible with.
  1393. loop=$age
  1394. while test $loop != 0; do
  1395. iface=`expr $current - $loop`
  1396. loop=`expr $loop - 1`
  1397. verstring="$verstring:${iface}.0"
  1398. done
  1399. # Make executables depend on our current version.
  1400. verstring="$verstring:${current}.0"
  1401. ;;
  1402. sunos)
  1403. major=".$current"
  1404. versuffix=".$current.$revision"
  1405. ;;
  1406. freebsd-aout)
  1407. major=".$current"
  1408. versuffix=".$current.$revision";
  1409. ;;
  1410. freebsd-elf)
  1411. major=".$current"
  1412. versuffix=".$current";
  1413. ;;
  1414. windows)
  1415. # Like Linux, but with '-' rather than '.', since we only
  1416. # want one extension on Windows 95.
  1417. major=`expr $current - $age`
  1418. versuffix="-$major-$age-$revision"
  1419. ;;
  1420. *)
  1421. $echo "$modename: unknown library version type \`$version_type'" 1>&2
  1422. echo "Fatal configuration error. See the $PACKAGE docs for more information." 1>&2
  1423. exit 1
  1424. ;;
  1425. esac
  1426. # Clear the version info if we defaulted, and they specified a release.
  1427. if test -z "$vinfo" && test -n "$release"; then
  1428. major=
  1429. verstring="0.0"
  1430. if test "$need_version" = no; then
  1431. versuffix=
  1432. else
  1433. versuffix=".0.0"
  1434. fi
  1435. fi
  1436. # Remove version info from name if versioning should be avoided
  1437. if test "$avoid_version" = yes && test "$need_version" = no; then
  1438. major=
  1439. versuffix=
  1440. verstring=""
  1441. fi
  1442. # Check to see if the archive will have undefined symbols.
  1443. if test "$allow_undefined" = yes; then
  1444. if test "$allow_undefined_flag" = unsupported; then
  1445. $echo "$modename: warning: undefined symbols not allowed in $host shared libraries" 1>&2
  1446. build_libtool_libs=no
  1447. build_old_libs=yes
  1448. fi
  1449. else
  1450. # Don't allow undefined symbols.
  1451. allow_undefined_flag="$no_undefined_flag"
  1452. fi
  1453. fi
  1454. if test "$mode" != relink; then
  1455. # Remove our outputs.
  1456. $show "${rm}r $output_objdir/$outputname $output_objdir/$libname.* $output_objdir/${libname}${release}.*"
  1457. $run ${rm}r $output_objdir/$outputname $output_objdir/$libname.* $output_objdir/${libname}${release}.*
  1458. fi
  1459. # Now set the variables for building old libraries.
  1460. if test "$build_old_libs" = yes && test "$build_libtool_libs" != convenience ; then
  1461. oldlibs="$oldlibs $output_objdir/$libname.$libext"
  1462. # Transform .lo files to .o files.
  1463. oldobjs="$objs "`$echo "X$libobjs" | $SP2NL | $Xsed -e '/\.'${libext}'$/d' -e "$lo2o" | $NL2SP`
  1464. fi
  1465. # Save some variables
  1466. name_save=$name
  1467. libname_save=$libname
  1468. # Find libtool libraries and add their dependencies and directories
  1469. save_deplibs="$deplibs"
  1470. deplibs= # libraries to link (used in archive_cmds)
  1471. newdependency_libs= # all dependency libraries
  1472. uninst_path= # paths that contain uninstalled libtool libraries
  1473. new_lib_search_path=
  1474. for deplib in $save_deplibs; do
  1475. lib=
  1476. case "$deplib" in
  1477. -L*)
  1478. case "$deplibs " in
  1479. *" $deplib "*) ;;
  1480. *)
  1481. deplibs="$deplibs $deplib"
  1482. newdependency_libs="$newdependency_libs $deplib"
  1483. new_lib_search_path="$new_lib_search_path "`$echo "X$deplib" | $Xsed -e 's/^-L//'`
  1484. ;;
  1485. esac
  1486. continue
  1487. ;;
  1488. -l*)
  1489. name=`$echo "X$deplib" | $Xsed -e 's/^-l//'`
  1490. found=no
  1491. for searchdir in $lib_search_path; do
  1492. # Search the libtool library
  1493. lib="$searchdir/lib${name}.la"
  1494. if test -f "$lib"; then
  1495. found=yes
  1496. break
  1497. fi
  1498. done
  1499. if test "$found" != yes; then
  1500. deplibs="$deplibs $deplib"
  1501. newdependency_libs="$newdependency_libs $deplib"
  1502. continue
  1503. fi
  1504. ;;
  1505. *)
  1506. lib="$deplib"
  1507. if test -f "$lib"; then :
  1508. else
  1509. $echo "$modename: cannot find the library \`$lib'" 1>&2
  1510. exit 1
  1511. fi
  1512. ;;
  1513. esac
  1514. libdir=
  1515. library_names=
  1516. old_library=
  1517. # Check to see that this really is a libtool archive.
  1518. if (sed -e '2q' $lib | egrep "^# Generated by .*$PACKAGE") >/dev/null 2>&1; then :
  1519. else
  1520. $echo "$modename: \`$lib' is not a valid libtool archive" 1>&2
  1521. exit 1
  1522. fi
  1523. ladir=`$echo "X$lib" | $Xsed -e 's%/[^/]*$%%'`
  1524. test "X$ladir" = "X$lib" && ladir="."
  1525. # We need an absolute path.
  1526. case "$ladir" in
  1527. [\\/]* | [A-Za-z]:[\\/]*) abs_ladir="$ladir" ;;
  1528. *)
  1529. abs_ladir=`cd "$ladir" && pwd`
  1530. if test -z "$abs_ladir"; then
  1531. $echo "$modename: warning: cannot determine absolute directory name of \`$ladir'" 1>&2
  1532. $echo "$modename: passing it literally to the linker, although it might fail" 1>&2
  1533. abs_ladir="$ladir"
  1534. fi
  1535. ;;
  1536. esac
  1537. laname=`$echo "X$lib" | $Xsed -e 's%^.*/%%'`
  1538. # If the library was installed with an old release of libtool,
  1539. # it will not redefine variable installed.
  1540. installed=yes
  1541. # Read the .la file
  1542. case "$lib" in
  1543. */* | *\\*) . $lib ;;
  1544. *) . ./$lib ;;
  1545. esac
  1546. # Get the name of the library we link against.
  1547. linklib=
  1548. for l in $old_library $library_names; do
  1549. linklib="$l"
  1550. done
  1551. if test -z "$linklib"; then
  1552. $echo "$modename: cannot find name of link library for \`$lib'" 1>&2
  1553. exit 1
  1554. fi
  1555. if test -z "$libdir"; then
  1556. # It is a libtool convenience library, so add in its objects.
  1557. convenience="$convenience $ladir/$objdir/$old_library"
  1558. old_convenience="$old_convenience $ladir/$objdir/$old_library"
  1559. deplibs="$deplibs $ladir/$objdir/$old_library"
  1560. newdependency_libs="$newdependency_libs $dependency_libs"
  1561. continue
  1562. fi
  1563. # Find the relevant object directory and library name.
  1564. if test "X$installed" = Xyes; then
  1565. if test ! -f "$libdir/$linklib" && test -f "$abs_ladir/$linklib"; then
  1566. $echo "$modename: warning: library \`$lib' was moved." 1>&2
  1567. dir="$ladir"
  1568. absdir="$abs_ladir"
  1569. libdir="$abs_ladir"
  1570. else
  1571. dir="$libdir"
  1572. absdir="$libdir"
  1573. fi
  1574. else
  1575. dir="$ladir/$objdir"
  1576. absdir="$abs_ladir/$objdir"
  1577. # Remove this search path later
  1578. uninst_path="$uninst_path $abs_ladir"
  1579. fi
  1580. name=`$echo "X$laname" | $Xsed -e 's/\.la$//' -e 's/^lib//'`
  1581. link_static=no # Whether this library is linked statically
  1582. if test -n "$library_names" &&
  1583. { test "$prefer_static_libs" = no || test -z "$old_library"; }; then
  1584. # This is a shared library
  1585. if test "$hardcode_into_libs" = all; then
  1586. # Hardcode the library path.
  1587. # Skip directories that are in the system default run-time
  1588. # search path.
  1589. case " $sys_lib_dlsearch_path " in
  1590. *" $absdir "*) ;;
  1591. *)
  1592. case "$compile_rpath " in
  1593. *" $absdir "*) ;;
  1594. *) compile_rpath="$compile_rpath $absdir"
  1595. esac
  1596. ;;
  1597. esac
  1598. case " $sys_lib_dlsearch_path " in
  1599. *" $libdir "*) ;;
  1600. *)
  1601. case "$finalize_rpath " in
  1602. *" $libdir "*) ;;
  1603. *) finalize_rpath="$finalize_rpath $libdir"
  1604. esac
  1605. ;;
  1606. esac
  1607. fi
  1608. if test -n "$old_archive_from_expsyms_cmds"; then
  1609. # figure out the soname
  1610. set dummy $library_names
  1611. realname="$2"
  1612. shift; shift
  1613. libname=`eval \\$echo \"$libname_spec\"`
  1614. if test -n "$soname_spec"; then
  1615. eval soname=\"$soname_spec\"
  1616. else
  1617. soname="$realname"
  1618. fi
  1619. # Make a new name for the extract_expsyms_cmds to use
  1620. newlib="libimp-`echo $soname | sed 's/^lib//;s/\.dll$//'`.a"
  1621. # If the library has no export list, then create one now
  1622. if test -f "$output_objdir/$soname-def"; then :
  1623. else
  1624. $show "extracting exported symbol list from \`$soname'"
  1625. IFS="${IFS= }"; save_ifs="$IFS"; IFS='~'
  1626. eval cmds=\"$extract_expsyms_cmds\"
  1627. for cmd in $cmds; do
  1628. IFS="$save_ifs"
  1629. $show "$cmd"
  1630. $run eval "$cmd" || exit $?
  1631. done
  1632. IFS="$save_ifs"
  1633. fi
  1634. # Create $newlib
  1635. if test -f "$output_objdir/$newlib"; then :; else
  1636. $show "generating import library for \`$soname'"
  1637. IFS="${IFS= }"; save_ifs="$IFS"; IFS='~'
  1638. eval cmds=\"$old_archive_from_expsyms_cmds\"
  1639. for cmd in $cmds; do
  1640. IFS="$save_ifs"
  1641. $show "$cmd"
  1642. $run eval "$cmd" || exit $?
  1643. done
  1644. IFS="$save_ifs"
  1645. fi
  1646. # make sure the library variables are pointing to the new library
  1647. dir=$output_objdir
  1648. linklib=$newlib
  1649. fi
  1650. add_dir=
  1651. add_shlibpath=
  1652. add_name=no
  1653. if test "$mode" != relink; then
  1654. lib_linked=yes
  1655. case "$hardcode_action" in
  1656. immediate | unsupported)
  1657. if test "$hardcode_direct" = no; then
  1658. deplibs="$deplibs $dir/$linklib"
  1659. elif test "$hardcode_minus_L" = no; then
  1660. case "$host" in
  1661. *-*-sunos*) add_shlibpath="$dir" ;;
  1662. esac
  1663. add_dir="-L$dir"
  1664. add_name=yes
  1665. elif test "$hardcode_shlibpath_var" = no; then
  1666. add_shlibpath="$dir"
  1667. add_name=yes
  1668. else
  1669. lib_linked=no
  1670. fi
  1671. ;;
  1672. relink)
  1673. if test "$hardcode_direct" = yes; then
  1674. deplibs="$deplibs $dir/$linklib"
  1675. elif test "$hardcode_minus_L" = yes; then
  1676. add_dir="-L$dir"
  1677. add_name=yes
  1678. elif test "$hardcode_shlibpath_var" = yes; then
  1679. add_shlibpath="$dir"
  1680. add_name=yes
  1681. else
  1682. lib_linked=no
  1683. fi
  1684. ;;
  1685. *) lib_linked=no ;;
  1686. esac
  1687. if test "$lib_linked" != yes; then
  1688. $echo "$modename: configuration error: unsupported hardcode properties"
  1689. exit 1
  1690. fi
  1691. if test -n "$add_shlibpath"; then
  1692. case ":$compile_shlibpath:" in
  1693. *":$add_shlibpath:"*) ;;
  1694. *) compile_shlibpath="$compile_shlibpath$add_shlibpath:" ;;
  1695. esac
  1696. fi
  1697. else
  1698. # Install command for both is simple: just hardcode it.
  1699. if test "$hardcode_direct" = yes; then
  1700. deplibs="$deplibs $libdir/$linklib"
  1701. elif test "$hardcode_minus_L" = yes; then
  1702. add_dir="-L$libdir"
  1703. add_name=yes
  1704. elif test "$hardcode_shlibpath_var" = yes; then
  1705. add_name=yes
  1706. else
  1707. # We cannot seem to hardcode it, guess we'll fake it.
  1708. add_dir="-L$libdir"
  1709. add_name=yes
  1710. fi
  1711. fi
  1712. if test "$hardcode_direct" != yes && \
  1713. test "$hardcode_minus_L" != yes && \
  1714. test "$hardcode_shlibpath_var" = yes; then
  1715. case ":$finalize_shlibpath:" in
  1716. *":$libdir:"*) ;;
  1717. *) finalize_shlibpath="$finalize_shlibpath$libdir:" ;;
  1718. esac
  1719. fi
  1720. if test -n "$add_dir"; then
  1721. case "$deplibs " in
  1722. *" $add_dir "*) ;;
  1723. *) deplibs="$deplibs $add_dir" ;;
  1724. esac
  1725. fi
  1726. test "$add_name" = yes && deplibs="$deplibs -l$name"
  1727. elif test "$build_libtool_libs" = yes; then
  1728. # Not a shared library
  1729. if test "$deplibs_check_method" != pass_all; then
  1730. # We're trying link a shared library against a static one
  1731. # but the system doesn't support it.
  1732. # Just print a warning and add the library to dependency_libs so
  1733. # that the program can be linked against the static library.
  1734. echo
  1735. echo "*** Warning: This library needs some functionality provided by $libname."
  1736. echo "*** I have the capability to make that library automatically link in when"
  1737. echo "*** you link to this library. But I can only do this if you have a"
  1738. echo "*** shared version of the library, which you do not appear to have."
  1739. else
  1740. convenience="$convenience $dir/$old_library"
  1741. old_convenience="$old_convenience $dir/$old_library"
  1742. deplibs="$deplibs $dir/$old_library"
  1743. link_static=yes
  1744. fi
  1745. fi
  1746. if test -n "$dependency_libs" &&
  1747. { test "$hardcode_into_libs" = no || test $build_old_libs = yes ||
  1748. test $link_static = yes; }; then
  1749. # Extract -R from dependency_libs
  1750. temp_deplibs=
  1751. for libdir in $dependency_libs; do
  1752. case "$libdir" in
  1753. -R*) temp_xrpath=`$echo "X$libdir" | $Xsed -e 's/^-R//'`
  1754. case " $xrpath " in
  1755. *" $temp_xrpath "*) ;;
  1756. *) xrpath="$xrpath $temp_xrpath";;
  1757. esac;;
  1758. *) temp_deplibs="$temp_deplibs $libdir";;
  1759. esac
  1760. done
  1761. dependency_libs="$temp_deplibs"
  1762. fi
  1763. new_lib_search_path="$new_lib_search_path $absdir"
  1764. # Link against this library
  1765. test "$link_static" = no && newdependency_libs="$newdependency_libs $abs_ladir/$laname"
  1766. # ... and its dependency_libs
  1767. newdependency_libs="$newdependency_libs $dependency_libs"
  1768. if test $link_all_deplibs != no; then
  1769. # Add the search paths of all dependency libraries
  1770. for deplib in $dependency_libs; do
  1771. case "$deplib" in
  1772. -L*) path="$deplib" ;;
  1773. *.la)
  1774. if grep "^installed=no" $deplib > /dev/null; then
  1775. dir=`$echo "X$deplib" | $Xsed -e 's%/[^/]*$%%'`
  1776. test "X$dir" = "X$deplib" && dir="."
  1777. # We need an absolute path.
  1778. case "$dir" in
  1779. [\\/]* | [A-Za-z]:[\\/]*) absdir="$dir" ;;
  1780. *)
  1781. absdir=`cd "$dir" && pwd`
  1782. if test -z "$absdir"; then
  1783. $echo "$modename: warning: cannot determine absolute directory name of \`$dir'" 1>&2
  1784. absdir="$dir"
  1785. fi
  1786. ;;
  1787. esac
  1788. path="-L$absdir/$objdir"
  1789. else
  1790. eval libdir=`sed -n -e 's/^libdir=\(.*\)$/\1/p' $deplib`
  1791. if test -z "$libdir"; then
  1792. $echo "$modename: \`$deplib' is not a valid libtool archive" 1>&2
  1793. exit 1
  1794. fi
  1795. path="-L$libdir"
  1796. fi
  1797. ;;
  1798. *)
  1799. continue
  1800. ;;
  1801. esac
  1802. case "$deplibs " in
  1803. *" $path "*) ;;
  1804. *) deplibs="$path $deplibs" ;;
  1805. esac
  1806. done
  1807. fi
  1808. done
  1809. # Make sure lib_search_path contains only unique directories.
  1810. lib_search_path=
  1811. for dir in $new_lib_search_path; do
  1812. case "$lib_search_path " in
  1813. *" $dir "*) ;;
  1814. *) lib_search_path="$lib_search_path $dir" ;;
  1815. esac
  1816. done
  1817. lib_search_path="$lib_search_path $sys_lib_search_path"
  1818. dependency_libs="$newdependency_libs"
  1819. # Eliminate all temporary directories.
  1820. for path in $uninst_path; do
  1821. lib_search_path=`echo "$lib_search_path " | sed -e 's% $path % %g'`
  1822. deplibs=`echo "$deplibs " | sed -e 's% -L$path % %g'`
  1823. dependency_libs=`echo "$dependency_libs " | sed -e 's% -L$path % %g'`
  1824. done
  1825. if test -n "$xrpath"; then
  1826. # If the user specified any rpath flags, then add them.
  1827. temp_xrpath=
  1828. for libdir in $xrpath; do
  1829. temp_xrpath="$temp_xrpath -R$libdir"
  1830. case "$finalize_rpath " in
  1831. *" $libdir "*) ;;
  1832. *) finalize_rpath="$finalize_rpath $libdir" ;;
  1833. esac
  1834. done
  1835. if test "$hardcode_into_libs" = no || test $build_old_libs = yes; then
  1836. dependency_libs="$temp_xrpath $dependency_libs"
  1837. fi
  1838. fi
  1839. # Restore the variables
  1840. libname=$libname_save
  1841. name=$name_save
  1842. if test "$build_libtool_libs" = yes; then
  1843. if test -n "$rpath"; then
  1844. case "$host" in
  1845. *-*-cygwin* | *-*-mingw* | *-*-os2* | *-*-beos*)
  1846. # these systems don't actually have a c library (as such)!
  1847. ;;
  1848. *)
  1849. # Add libc to deplibs on all other systems.
  1850. deplibs="$deplibs -lc"
  1851. ;;
  1852. esac
  1853. fi
  1854. # Transform deplibs into only deplibs that can be linked in shared.
  1855. name_save=$name
  1856. libname_save=$libname
  1857. release_save=$release
  1858. versuffix_save=$versuffix
  1859. major_save=$major
  1860. # I'm not sure if I'm treating the release correctly. I think
  1861. # release should show up in the -l (ie -lgmp5) so we don't want to
  1862. # add it in twice. Is that correct?
  1863. release=""
  1864. versuffix=""
  1865. major=""
  1866. newdeplibs=
  1867. droppeddeps=no
  1868. case "$deplibs_check_method" in
  1869. pass_all)
  1870. # Don't check for shared/static. Everything works.
  1871. # This might be a little naive. We might want to check
  1872. # whether the library exists or not. But this is on
  1873. # osf3 & osf4 and I'm not really sure... Just
  1874. # implementing what was already the behaviour.
  1875. newdeplibs=$deplibs
  1876. ;;
  1877. test_compile)
  1878. # This code stresses the "libraries are programs" paradigm to its
  1879. # limits. Maybe even breaks it. We compile a program, linking it
  1880. # against the deplibs as a proxy for the library. Then we can check
  1881. # whether they linked in statically or dynamically with ldd.
  1882. $rm conftest.c
  1883. cat > conftest.c <<EOF
  1884. int main() { return 0; }
  1885. EOF
  1886. $rm conftest
  1887. $CC -o conftest conftest.c $deplibs
  1888. if test $? -eq 0 ; then
  1889. ldd_output=`ldd conftest`
  1890. for i in $deplibs; do
  1891. name="`expr $i : '-l\(.*\)'`"
  1892. # If $name is empty we are operating on a -L argument.
  1893. if test "$name" != "" ; then
  1894. libname=`eval \\$echo \"$libname_spec\"`
  1895. deplib_matches=`eval \\$echo \"$library_names_spec\"`
  1896. set dummy $deplib_matches
  1897. deplib_match=$2
  1898. if test `expr "$ldd_output" : ".*$deplib_match"` -ne 0 ; then
  1899. newdeplibs="$newdeplibs $i"
  1900. else
  1901. droppeddeps=yes
  1902. echo
  1903. echo "*** Warning: This library needs some functionality provided by $i."
  1904. echo "*** I have the capability to make that library automatically link in when"
  1905. echo "*** you link to this library. But I can only do this if you have a"
  1906. echo "*** shared version of the library, which you do not appear to have."
  1907. fi
  1908. else
  1909. newdeplibs="$newdeplibs $i"
  1910. fi
  1911. done
  1912. else
  1913. # Error occured in the first compile. Let's try to salvage the situation:
  1914. # Compile a seperate program for each library.
  1915. for i in $deplibs; do
  1916. name="`expr $i : '-l\(.*\)'`"
  1917. # If $name is empty we are operating on a -L argument.
  1918. if test "$name" != "" ; then
  1919. $rm conftest
  1920. $CC -o conftest conftest.c $i
  1921. # Did it work?
  1922. if test $? -eq 0 ; then
  1923. ldd_output=`ldd conftest`
  1924. libname=`eval \\$echo \"$libname_spec\"`
  1925. deplib_matches=`eval \\$echo \"$library_names_spec\"`
  1926. set dummy $deplib_matches
  1927. deplib_match=$2
  1928. if test `expr "$ldd_output" : ".*$deplib_match"` -ne 0 ; then
  1929. newdeplibs="$newdeplibs $i"
  1930. else
  1931. droppeddeps=yes
  1932. echo
  1933. echo "*** Warning: This library needs some functionality provided by $i."
  1934. echo "*** I have the capability to make that library automatically link in when"
  1935. echo "*** you link to this library. But I can only do this if you have a"
  1936. echo "*** shared version of the library, which you do not appear to have."
  1937. fi
  1938. else
  1939. droppeddeps=yes
  1940. echo
  1941. echo "*** Warning! Library $i is needed by this library but I was not able to"
  1942. echo "*** make it link in! You will probably need to install it or some"
  1943. echo "*** library that it depends on before this library will be fully"
  1944. echo "*** functional. Installing it before continuing would be even better."
  1945. fi
  1946. else
  1947. newdeplibs="$newdeplibs $i"
  1948. fi
  1949. done
  1950. fi
  1951. ;;
  1952. file_magic*)
  1953. set dummy $deplibs_check_method
  1954. file_magic_regex=`expr "$deplibs_check_method" : "$2 \(.*\)"`
  1955. for a_deplib in $deplibs; do
  1956. name="`expr $a_deplib : '-l\(.*\)'`"
  1957. # If $name is empty we are operating on a -L argument.
  1958. if test "$name" != "" ; then
  1959. libname=`eval \\$echo \"$libname_spec\"`
  1960. for i in $lib_search_path; do
  1961. potential_libs=`ls $i/$libname[.-]* 2>/dev/null`
  1962. for potent_lib in $potential_libs; do
  1963. # Follow soft links.
  1964. if ls -lLd "$potent_lib" 2>/dev/null \
  1965. | grep " -> " >/dev/null; then
  1966. continue
  1967. fi
  1968. # The statement above tries to avoid entering an
  1969. # endless loop below, in case of cyclic links.
  1970. # We might still enter an endless loop, since a link
  1971. # loop can be closed while we follow links,
  1972. # but so what?
  1973. potlib="$potent_lib"
  1974. while test -h "$potlib" 2>/dev/null; do
  1975. potliblink=`ls -ld $potlib | sed 's/.* -> //'`
  1976. case "$potliblink" in
  1977. [\\/]* | [A-Za-z]:[\\/]*) potlib="$potliblink";;
  1978. *) potlib=`$echo "X$potlib" | $Xsed -e 's,[^/]*$,,'`"$potliblink";;
  1979. esac
  1980. done
  1981. if eval $file_magic_cmd \"\$potlib\" 2>/dev/null \
  1982. | sed 10q \
  1983. | egrep "$file_magic_regex" > /dev/null; then
  1984. newdeplibs="$newdeplibs $a_deplib"
  1985. a_deplib=""
  1986. break 2
  1987. fi
  1988. done
  1989. done
  1990. if test -n "$a_deplib" ; then
  1991. droppeddeps=yes
  1992. echo
  1993. echo "*** Warning: This library needs some functionality provided by $a_deplib."
  1994. echo "*** I have the capability to make that library automatically link in when"
  1995. echo "*** you link to this library. But I can only do this if you have a"
  1996. echo "*** shared version of the library, which you do not appear to have."
  1997. fi
  1998. else
  1999. # Add a -L argument.
  2000. newdeplibs="$newdeplibs $a_deplib"
  2001. fi
  2002. done # Gone through all deplibs.
  2003. ;;
  2004. none | unknown | *)
  2005. newdeplibs=""
  2006. if $echo "X $deplibs" | $Xsed -e 's/ -lc$//' \
  2007. -e 's/ -[LR][^ ]*//g' -e 's/[ ]//g' |
  2008. grep . >/dev/null; then
  2009. echo
  2010. if test "X$deplibs_check_method" = "Xnone"; then
  2011. echo "*** Warning: inter-library dependencies are not supported in this platform."
  2012. else
  2013. echo "*** Warning: inter-library dependencies are not known to be supported."
  2014. fi
  2015. echo "*** All declared inter-library dependencies are being dropped."
  2016. droppeddeps=yes
  2017. fi
  2018. ;;
  2019. esac
  2020. versuffix=$versuffix_save
  2021. major=$major_save
  2022. release=$release_save
  2023. libname=$libname_save
  2024. name=$name_save
  2025. if test "$droppeddeps" = yes; then
  2026. if test "$module" = yes; then
  2027. echo
  2028. echo "*** Warning: libtool could not satisfy all declared inter-library"
  2029. echo "*** dependencies of module $libname. Therefore, libtool will create"
  2030. echo "*** a static module, that should work as long as the dlopening"
  2031. echo "*** application is linked with the -dlopen flag."
  2032. if test -z "$global_symbol_pipe"; then
  2033. echo
  2034. echo "*** However, this would only work if libtool was able to extract symbol"
  2035. echo "*** lists from a program, using \`nm' or equivalent, but libtool could"
  2036. echo "*** not find such a program. So, this module is probably useless."
  2037. echo "*** \`nm' from GNU binutils and a full rebuild may help."
  2038. fi
  2039. if test "$build_old_libs" = no; then
  2040. oldlibs="$output_objdir/$libname.$libext"
  2041. build_libtool_libs=module
  2042. build_old_libs=yes
  2043. else
  2044. build_libtool_libs=no
  2045. fi
  2046. else
  2047. echo "*** The inter-library dependencies that have been dropped here will be"
  2048. echo "*** automatically added whenever a program is linked with this library"
  2049. echo "*** or is declared to -dlopen it."
  2050. fi
  2051. fi
  2052. # Done checking deplibs!
  2053. deplibs=$newdeplibs
  2054. fi
  2055. # All the library-specific variables (install_libdir is set above).
  2056. library_names=
  2057. old_library=
  2058. dlname=
  2059. # Test again, we may have decided not to build it any more
  2060. if test "$build_libtool_libs" = yes; then
  2061. if test "$hardcode_into_libs" != no; then
  2062. # Hardcode the library paths
  2063. hardcode_libdirs=
  2064. dep_rpath=
  2065. rpath="$finalize_rpath"
  2066. test "$mode" != relink && rpath="$compile_rpath$rpath"
  2067. for libdir in $rpath; do
  2068. if test -n "$hardcode_libdir_flag_spec"; then
  2069. if test -n "$hardcode_libdir_separator"; then
  2070. if test -z "$hardcode_libdirs"; then
  2071. hardcode_libdirs="$libdir"
  2072. else
  2073. # Just accumulate the unique libdirs.
  2074. case "$hardcode_libdir_separator$hardcode_libdirs$hardcode_libdir_separator" in
  2075. *"$hardcode_libdir_separator$libdir$hardcode_libdir_separator"*)
  2076. ;;
  2077. *)
  2078. hardcode_libdirs="$hardcode_libdirs$hardcode_libdir_separator$libdir"
  2079. ;;
  2080. esac
  2081. fi
  2082. else
  2083. eval flag=\"$hardcode_libdir_flag_spec\"
  2084. dep_rpath="$dep_rpath $flag"
  2085. fi
  2086. elif test -n "$runpath_var"; then
  2087. case "$perm_rpath " in
  2088. *" $libdir "*) ;;
  2089. *) perm_rpath="$perm_rpath $libdir" ;;
  2090. esac
  2091. fi
  2092. done
  2093. # Substitute the hardcoded libdirs into the rpath.
  2094. if test -n "$hardcode_libdir_separator" &&
  2095. test -n "$hardcode_libdirs"; then
  2096. libdir="$hardcode_libdirs"
  2097. eval dep_rpath=\"$hardcode_libdir_flag_spec\"
  2098. fi
  2099. if test -n "$runpath_var" && test -n "$perm_rpath"; then
  2100. # We should set the runpath_var.
  2101. rpath=
  2102. for dir in $perm_rpath; do
  2103. rpath="$rpath$dir:"
  2104. done
  2105. eval "$runpath_var='$rpath\$$runpath_var'; export $runpath_var"
  2106. fi
  2107. test -n "$dep_rpath" && deplibs="$dep_rpath $deplibs"
  2108. fi
  2109. shlibpath="$finalize_shlibpath"
  2110. test "$mode" != relink && shlibpath="$compile_shlibpath$shlibpath"
  2111. if test -n "$shlibpath"; then
  2112. eval "$shlibpath_var='$shlibpath\$$shlibpath_var'; export $shlibpath_var"
  2113. fi
  2114. # Get the real and link names of the library.
  2115. eval library_names=\"$library_names_spec\"
  2116. set dummy $library_names
  2117. realname="$2"
  2118. shift; shift
  2119. if test -n "$soname_spec"; then
  2120. eval soname=\"$soname_spec\"
  2121. else
  2122. soname="$realname"
  2123. fi
  2124. lib="$output_objdir/$realname"
  2125. for link
  2126. do
  2127. linknames="$linknames $link"
  2128. done
  2129. # Ensure that we have .o objects for linkers which dislike .lo
  2130. # (e.g. aix) in case we are running --disable-static
  2131. for obj in $libobjs; do
  2132. xdir=`$echo "X$obj" | $Xsed -e 's%/[^/]*$%%'`
  2133. if test "X$xdir" = "X$obj"; then
  2134. xdir="."
  2135. else
  2136. xdir="$xdir"
  2137. fi
  2138. baseobj=`$echo "X$obj" | $Xsed -e 's%^.*/%%'`
  2139. oldobj=`$echo "X$baseobj" | $Xsed -e "$lo2o"`
  2140. if test ! -f $xdir/$oldobj; then
  2141. $show "(cd $xdir && ${LN_S} $baseobj $oldobj)"
  2142. $run eval '(cd $xdir && ${LN_S} $baseobj $oldobj)' || exit $?
  2143. fi
  2144. done
  2145. # Use standard objects if they are pic
  2146. test -z "$pic_flag" && libobjs=`$echo "X$libobjs" | $SP2NL | $Xsed -e "$lo2o" | $NL2SP`
  2147. # Prepare the list of exported symbols
  2148. if test -z "$export_symbols"; then
  2149. if test "$always_export_symbols" = yes || test -n "$export_symbols_regex"; then
  2150. $show "generating symbol list for \`$libname.la'"
  2151. export_symbols="$output_objdir/$libname.exp"
  2152. $run $rm $export_symbols
  2153. eval cmds=\"$export_symbols_cmds\"
  2154. IFS="${IFS= }"; save_ifs="$IFS"; IFS='~'
  2155. for cmd in $cmds; do
  2156. IFS="$save_ifs"
  2157. $show "$cmd"
  2158. $run eval "$cmd" || exit $?
  2159. done
  2160. IFS="$save_ifs"
  2161. if test -n "$export_symbols_regex"; then
  2162. $show "egrep -e \"$export_symbols_regex\" \"$export_symbols\" > \"${export_symbols}T\""
  2163. $run eval 'egrep -e "$export_symbols_regex" "$export_symbols" > "${export_symbols}T"'
  2164. $show "$mv \"${export_symbols}T\" \"$export_symbols\""
  2165. $run eval '$mv "${export_symbols}T" "$export_symbols"'
  2166. fi
  2167. fi
  2168. fi
  2169. if test -n "$export_symbols" && test -n "$include_expsyms"; then
  2170. $run eval '$echo "X$include_expsyms" | $SP2NL >> "$export_symbols"'
  2171. fi
  2172. if test -n "$convenience"; then
  2173. if test -n "$whole_archive_flag_spec"; then
  2174. eval libobjs=\"\$libobjs $whole_archive_flag_spec\"
  2175. else
  2176. gentop="$output_objdir/${outputname}x"
  2177. $show "${rm}r $gentop"
  2178. $run ${rm}r "$gentop"
  2179. $show "mkdir $gentop"
  2180. $run mkdir "$gentop"
  2181. status=$?
  2182. if test $status -ne 0 && test ! -d "$gentop"; then
  2183. exit $status
  2184. fi
  2185. generated="$generated $gentop"
  2186. for xlib in $convenience; do
  2187. # Extract the objects.
  2188. case "$xlib" in
  2189. [\\/]* | [A-Za-z]:[\\/]*) xabs="$xlib" ;;
  2190. *) xabs=`pwd`"/$xlib" ;;
  2191. esac
  2192. xlib=`$echo "X$xlib" | $Xsed -e 's%^.*/%%'`
  2193. xdir="$gentop/$xlib"
  2194. $show "${rm}r $xdir"
  2195. $run ${rm}r "$xdir"
  2196. $show "mkdir $xdir"
  2197. $run mkdir "$xdir"
  2198. status=$?
  2199. if test $status -ne 0 && test ! -d "$xdir"; then
  2200. exit $status
  2201. fi
  2202. $show "(cd $xdir && $AR x $xabs)"
  2203. $run eval "(cd \$xdir && $AR x \$xabs)" || exit $?
  2204. libobjs="$libobjs "`find $xdir -name \*.o -print -o -name \*.lo -print | $NL2SP`
  2205. done
  2206. fi
  2207. fi
  2208. if test "$thread_safe" = yes && test -n "$thread_safe_flag_spec"; then
  2209. eval flag=\"$thread_safe_flag_spec\"
  2210. linker_flags="$linker_flags $flag"
  2211. fi
  2212. # Make a backup of the uninstalled library when relinking
  2213. if test "$mode" = relink && test "$hardcode_into_libs" = all; then
  2214. $run eval '(cd $output_objdir && $rm ${realname}U && $mv $realname ${realname}U)' || exit $?
  2215. fi
  2216. # Do each of the archive commands.
  2217. if test -n "$export_symbols" && test -n "$archive_expsym_cmds"; then
  2218. eval cmds=\"$archive_expsym_cmds\"
  2219. else
  2220. eval cmds=\"$archive_cmds\"
  2221. fi
  2222. IFS="${IFS= }"; save_ifs="$IFS"; IFS='~'
  2223. for cmd in $cmds; do
  2224. IFS="$save_ifs"
  2225. $show "$cmd"
  2226. $run eval "$cmd" || exit $?
  2227. done
  2228. IFS="$save_ifs"
  2229. # Restore the uninstalled library and exit
  2230. if test "$mode" = relink && test "$hardcode_into_libs" = all; then
  2231. $run eval '(cd $output_objdir && $rm ${realname}T && $mv $realname ${realname}T && $mv "$realname"U $realname)' || exit $?
  2232. exit 0
  2233. fi
  2234. # Create links to the real library.
  2235. for linkname in $linknames; do
  2236. if test "$realname" != "$linkname"; then
  2237. $show "(cd $output_objdir && $rm $linkname && $LN_S $realname $linkname)"
  2238. $run eval