Team Fortress 2 Source Code as on 22/4/2020
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.

5130 lines
141 KiB

  1. # ltmain.sh - Provide generalized library-building support services.
  2. # NOTE: Changing this file will not affect anything until you rerun configure.
  3. #
  4. # Copyright (C) 1996, 1997, 1998, 1999, 2000, 2001
  5. # Free Software Foundation, Inc.
  6. # Originally by Gordon Matzigkeit <[email protected]>, 1996
  7. #
  8. # This program is free software; you can redistribute it and/or modify
  9. # it under the terms of the GNU General Public License as published by
  10. # the Free Software Foundation; either version 2 of the License, or
  11. # (at your option) any later version.
  12. #
  13. # This program is distributed in the hope that it will be useful, but
  14. # WITHOUT ANY WARRANTY; without even the implied warranty of
  15. # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
  16. # General Public License for more details.
  17. #
  18. # You should have received a copy of the GNU General Public License
  19. # along with this program; if not, write to the Free Software
  20. # Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
  21. #
  22. # As a special exception to the GNU General Public License, if you
  23. # distribute this file as part of a program that contains a
  24. # configuration script generated by Autoconf, you may include it under
  25. # the same distribution terms that you use for the rest of that program.
  26. # Check that we have a working $echo.
  27. if test "X$1" = X--no-reexec; then
  28. # Discard the --no-reexec flag, and continue.
  29. shift
  30. elif test "X$1" = X--fallback-echo; then
  31. # Avoid inline document here, it may be left over
  32. :
  33. elif test "X`($echo '\t') 2>/dev/null`" = 'X\t'; then
  34. # Yippee, $echo works!
  35. :
  36. else
  37. # Restart under the correct shell, and then maybe $echo will work.
  38. exec $SHELL "$0" --no-reexec ${1+"$@"}
  39. fi
  40. if test "X$1" = X--fallback-echo; then
  41. # used as fallback echo
  42. shift
  43. cat <<EOF
  44. $*
  45. EOF
  46. exit 0
  47. fi
  48. # define SED for historic ltconfig's generated by Libtool 1.3
  49. test -z "$SED" && SED=sed
  50. # The name of this program.
  51. progname=`$echo "$0" | ${SED} 's%^.*/%%'`
  52. modename="$progname"
  53. # Constants.
  54. PROGRAM=ltmain.sh
  55. PACKAGE=libtool
  56. VERSION=1.4.3
  57. TIMESTAMP=" (1.922.2.110 2002/10/23 01:39:54)"
  58. default_mode=
  59. help="Try \`$progname --help' for more information."
  60. magic="%%%MAGIC variable%%%"
  61. mkdir="mkdir"
  62. mv="mv -f"
  63. rm="rm -f"
  64. # Sed substitution that helps us do robust quoting. It backslashifies
  65. # metacharacters that are still active within double-quoted strings.
  66. Xsed="${SED}"' -e 1s/^X//'
  67. sed_quote_subst='s/\([\\`\\"$\\\\]\)/\\\1/g'
  68. # test EBCDIC or ASCII
  69. case `echo A|od -x` in
  70. *[Cc]1*) # EBCDIC based system
  71. SP2NL="tr '\100' '\n'"
  72. NL2SP="tr '\r\n' '\100\100'"
  73. ;;
  74. *) # Assume ASCII based system
  75. SP2NL="tr '\040' '\012'"
  76. NL2SP="tr '\015\012' '\040\040'"
  77. ;;
  78. esac
  79. # NLS nuisances.
  80. # Only set LANG and LC_ALL to C if already set.
  81. # These must not be set unconditionally because not all systems understand
  82. # e.g. LANG=C (notably SCO).
  83. # We save the old values to restore during execute mode.
  84. if test "${LC_ALL+set}" = set; then
  85. save_LC_ALL="$LC_ALL"; LC_ALL=C; export LC_ALL
  86. fi
  87. if test "${LANG+set}" = set; then
  88. save_LANG="$LANG"; LANG=C; export LANG
  89. fi
  90. # Make sure IFS has a sensible default
  91. : ${IFS=" "}
  92. if test "$build_libtool_libs" != yes && test "$build_old_libs" != yes; then
  93. echo "$modename: not configured to build any kind of library" 1>&2
  94. echo "Fatal configuration error. See the $PACKAGE docs for more information." 1>&2
  95. exit 1
  96. fi
  97. # Global variables.
  98. mode=$default_mode
  99. nonopt=
  100. prev=
  101. prevopt=
  102. run=
  103. show="$echo"
  104. show_help=
  105. execute_dlfiles=
  106. lo2o="s/\\.lo\$/.${objext}/"
  107. o2lo="s/\\.${objext}\$/.lo/"
  108. # Parse our command line options once, thoroughly.
  109. while test $# -gt 0
  110. do
  111. arg="$1"
  112. shift
  113. case $arg in
  114. -*=*) optarg=`$echo "X$arg" | $Xsed -e 's/[-_a-zA-Z0-9]*=//'` ;;
  115. *) optarg= ;;
  116. esac
  117. # If the previous option needs an argument, assign it.
  118. if test -n "$prev"; then
  119. case $prev in
  120. execute_dlfiles)
  121. execute_dlfiles="$execute_dlfiles $arg"
  122. ;;
  123. *)
  124. eval "$prev=\$arg"
  125. ;;
  126. esac
  127. prev=
  128. prevopt=
  129. continue
  130. fi
  131. # Have we seen a non-optional argument yet?
  132. case $arg in
  133. --help)
  134. show_help=yes
  135. ;;
  136. --version)
  137. echo "$PROGRAM (GNU $PACKAGE) $VERSION$TIMESTAMP"
  138. exit 0
  139. ;;
  140. --config)
  141. ${SED} -e '1,/^# ### BEGIN LIBTOOL CONFIG/d' -e '/^# ### END LIBTOOL CONFIG/,$d' $0
  142. exit 0
  143. ;;
  144. --debug)
  145. echo "$progname: enabling shell trace mode"
  146. set -x
  147. ;;
  148. --dry-run | -n)
  149. run=:
  150. ;;
  151. --features)
  152. echo "host: $host"
  153. if test "$build_libtool_libs" = yes; then
  154. echo "enable shared libraries"
  155. else
  156. echo "disable shared libraries"
  157. fi
  158. if test "$build_old_libs" = yes; then
  159. echo "enable static libraries"
  160. else
  161. echo "disable static libraries"
  162. fi
  163. exit 0
  164. ;;
  165. --finish) mode="finish" ;;
  166. --mode) prevopt="--mode" prev=mode ;;
  167. --mode=*) mode="$optarg" ;;
  168. --preserve-dup-deps) duplicate_deps="yes" ;;
  169. --quiet | --silent)
  170. show=:
  171. ;;
  172. -dlopen)
  173. prevopt="-dlopen"
  174. prev=execute_dlfiles
  175. ;;
  176. -*)
  177. $echo "$modename: unrecognized option \`$arg'" 1>&2
  178. $echo "$help" 1>&2
  179. exit 1
  180. ;;
  181. *)
  182. nonopt="$arg"
  183. break
  184. ;;
  185. esac
  186. done
  187. if test -n "$prevopt"; then
  188. $echo "$modename: option \`$prevopt' requires an argument" 1>&2
  189. $echo "$help" 1>&2
  190. exit 1
  191. fi
  192. # Mandrake: (gc) It's bad to link C++ code with GCC, so we need to use the compiler name if provided
  193. if test "$mode" = link && test -n "$archive_cmds" && test -x "/usr/bin/perl"; then
  194. case $nonopt in
  195. *cc | *++ | gcc* | *-gcc* | egcs*)
  196. archive_cmds=`echo $archive_cmds | perl -pe 's/^\S+\s+//'`
  197. archive_cmds="$nonopt $archive_cmds"
  198. archive_expsym_cmds=`echo $archive_expsym_cmds | perl -pe 's/^\S+\s+//'`
  199. archive_expsym_cmds="$nonopt $archive_expsym_cmds"
  200. esac
  201. fi
  202. # If this variable is set in any of the actions, the command in it
  203. # will be execed at the end. This prevents here-documents from being
  204. # left over by shells.
  205. exec_cmd=
  206. if test -z "$show_help"; then
  207. # Infer the operation mode.
  208. if test -z "$mode"; then
  209. case $nonopt in
  210. *cc | *++ | gcc* | *-gcc* | xlc*)
  211. mode=link
  212. for arg
  213. do
  214. case $arg in
  215. -c)
  216. mode=compile
  217. break
  218. ;;
  219. esac
  220. done
  221. ;;
  222. *db | *dbx | *strace | *truss)
  223. mode=execute
  224. ;;
  225. *install*|cp|mv)
  226. mode=install
  227. ;;
  228. *rm)
  229. mode=uninstall
  230. ;;
  231. *)
  232. # If we have no mode, but dlfiles were specified, then do execute mode.
  233. test -n "$execute_dlfiles" && mode=execute
  234. # Just use the default operation mode.
  235. if test -z "$mode"; then
  236. if test -n "$nonopt"; then
  237. $echo "$modename: warning: cannot infer operation mode from \`$nonopt'" 1>&2
  238. else
  239. $echo "$modename: warning: cannot infer operation mode without MODE-ARGS" 1>&2
  240. fi
  241. fi
  242. ;;
  243. esac
  244. fi
  245. # Only execute mode is allowed to have -dlopen flags.
  246. if test -n "$execute_dlfiles" && test "$mode" != execute; then
  247. $echo "$modename: unrecognized option \`-dlopen'" 1>&2
  248. $echo "$help" 1>&2
  249. exit 1
  250. fi
  251. # Change the help message to a mode-specific one.
  252. generic_help="$help"
  253. help="Try \`$modename --help --mode=$mode' for more information."
  254. # These modes are in order of execution frequency so that they run quickly.
  255. case $mode in
  256. # libtool compile mode
  257. compile)
  258. modename="$modename: compile"
  259. # Get the compilation command and the source file.
  260. base_compile=
  261. prev=
  262. lastarg=
  263. srcfile="$nonopt"
  264. suppress_output=
  265. user_target=no
  266. for arg
  267. do
  268. case $prev in
  269. "") ;;
  270. xcompiler)
  271. # Aesthetically quote the previous argument.
  272. prev=
  273. lastarg=`$echo "X$arg" | $Xsed -e "$sed_quote_subst"`
  274. case $arg in
  275. # Double-quote args containing other shell metacharacters.
  276. # Many Bourne shells cannot handle close brackets correctly
  277. # in scan sets, so we specify it separately.
  278. *[\[\~\#\^\&\*\(\)\{\}\|\;\<\>\?\'\ \ ]*|*]*|"")
  279. arg="\"$arg\""
  280. ;;
  281. esac
  282. # Add the previous argument to base_compile.
  283. if test -z "$base_compile"; then
  284. base_compile="$lastarg"
  285. else
  286. base_compile="$base_compile $lastarg"
  287. fi
  288. continue
  289. ;;
  290. esac
  291. # Accept any command-line options.
  292. case $arg in
  293. -o)
  294. if test "$user_target" != "no"; then
  295. $echo "$modename: you cannot specify \`-o' more than once" 1>&2
  296. exit 1
  297. fi
  298. user_target=next
  299. ;;
  300. -static)
  301. build_old_libs=yes
  302. continue
  303. ;;
  304. -prefer-pic)
  305. pic_mode=yes
  306. continue
  307. ;;
  308. -prefer-non-pic)
  309. pic_mode=no
  310. continue
  311. ;;
  312. -Xcompiler)
  313. prev=xcompiler
  314. continue
  315. ;;
  316. -Wc,*)
  317. args=`$echo "X$arg" | $Xsed -e "s/^-Wc,//"`
  318. lastarg=
  319. save_ifs="$IFS"; IFS=','
  320. for arg in $args; do
  321. IFS="$save_ifs"
  322. # Double-quote args containing other shell metacharacters.
  323. # Many Bourne shells cannot handle close brackets correctly
  324. # in scan sets, so we specify it separately.
  325. case $arg in
  326. *[\[\~\#\^\&\*\(\)\{\}\|\;\<\>\?\'\ \ ]*|*]*|"")
  327. arg="\"$arg\""
  328. ;;
  329. esac
  330. lastarg="$lastarg $arg"
  331. done
  332. IFS="$save_ifs"
  333. lastarg=`$echo "X$lastarg" | $Xsed -e "s/^ //"`
  334. # Add the arguments to base_compile.
  335. if test -z "$base_compile"; then
  336. base_compile="$lastarg"
  337. else
  338. base_compile="$base_compile $lastarg"
  339. fi
  340. continue
  341. ;;
  342. esac
  343. case $user_target in
  344. next)
  345. # The next one is the -o target name
  346. user_target=yes
  347. continue
  348. ;;
  349. yes)
  350. # We got the output file
  351. user_target=set
  352. libobj="$arg"
  353. continue
  354. ;;
  355. esac
  356. # Accept the current argument as the source file.
  357. lastarg="$srcfile"
  358. srcfile="$arg"
  359. # Aesthetically quote the previous argument.
  360. # Backslashify any backslashes, double quotes, and dollar signs.
  361. # These are the only characters that are still specially
  362. # interpreted inside of double-quoted scrings.
  363. lastarg=`$echo "X$lastarg" | $Xsed -e "$sed_quote_subst"`
  364. # Double-quote args containing other shell metacharacters.
  365. # Many Bourne shells cannot handle close brackets correctly
  366. # in scan sets, so we specify it separately.
  367. case $lastarg in
  368. *[\[\~\#\^\&\*\(\)\{\}\|\;\<\>\?\'\ \ ]*|*]*|"")
  369. lastarg="\"$lastarg\""
  370. ;;
  371. esac
  372. # Add the previous argument to base_compile.
  373. if test -z "$base_compile"; then
  374. base_compile="$lastarg"
  375. else
  376. base_compile="$base_compile $lastarg"
  377. fi
  378. done
  379. case $user_target in
  380. set)
  381. ;;
  382. no)
  383. # Get the name of the library object.
  384. libobj=`$echo "X$srcfile" | $Xsed -e 's%^.*/%%'`
  385. ;;
  386. *)
  387. $echo "$modename: you must specify a target with \`-o'" 1>&2
  388. exit 1
  389. ;;
  390. esac
  391. # Recognize several different file suffixes.
  392. # If the user specifies -o file.o, it is replaced with file.lo
  393. xform='[cCFSfmso]'
  394. case $libobj in
  395. *.ada) xform=ada ;;
  396. *.adb) xform=adb ;;
  397. *.ads) xform=ads ;;
  398. *.asm) xform=asm ;;
  399. *.c++) xform=c++ ;;
  400. *.cc) xform=cc ;;
  401. *.cpp) xform=cpp ;;
  402. *.cxx) xform=cxx ;;
  403. *.f90) xform=f90 ;;
  404. *.for) xform=for ;;
  405. esac
  406. libobj=`$echo "X$libobj" | $Xsed -e "s/\.$xform$/.lo/"`
  407. case $libobj in
  408. *.lo) obj=`$echo "X$libobj" | $Xsed -e "$lo2o"` ;;
  409. *)
  410. $echo "$modename: cannot determine name of library object from \`$libobj'" 1>&2
  411. exit 1
  412. ;;
  413. esac
  414. if test -z "$base_compile"; then
  415. $echo "$modename: you must specify a compilation command" 1>&2
  416. $echo "$help" 1>&2
  417. exit 1
  418. fi
  419. # Delete any leftover library objects.
  420. if test "$build_old_libs" = yes; then
  421. removelist="$obj $libobj"
  422. else
  423. removelist="$libobj"
  424. fi
  425. $run $rm $removelist
  426. trap "$run $rm $removelist; exit 1" 1 2 15
  427. # On Cygwin there's no "real" PIC flag so we must build both object types
  428. case $host_os in
  429. cygwin* | mingw* | pw32* | os2*)
  430. pic_mode=default
  431. ;;
  432. esac
  433. if test "$pic_mode" = no && test "$deplibs_check_method" != pass_all; then
  434. # non-PIC code in shared libraries is not supported
  435. pic_mode=default
  436. fi
  437. # Calculate the filename of the output object if compiler does
  438. # not support -o with -c
  439. if test "$compiler_c_o" = no; then
  440. output_obj=`$echo "X$srcfile" | $Xsed -e 's%^.*/%%' -e 's%\.[^.]*$%%'`.${objext}
  441. lockfile="$output_obj.lock"
  442. removelist="$removelist $output_obj $lockfile"
  443. trap "$run $rm $removelist; exit 1" 1 2 15
  444. else
  445. need_locks=no
  446. lockfile=
  447. fi
  448. # Lock this critical section if it is needed
  449. # We use this script file to make the link, it avoids creating a new file
  450. if test "$need_locks" = yes; then
  451. until $run ln "$0" "$lockfile" 2>/dev/null; do
  452. $show "Waiting for $lockfile to be removed"
  453. sleep 2
  454. done
  455. elif test "$need_locks" = warn; then
  456. if test -f "$lockfile"; then
  457. echo "\
  458. *** ERROR, $lockfile exists and contains:
  459. `cat $lockfile 2>/dev/null`
  460. This indicates that another process is trying to use the same
  461. temporary object file, and libtool could not work around it because
  462. your compiler does not support \`-c' and \`-o' together. If you
  463. repeat this compilation, it may succeed, by chance, but you had better
  464. avoid parallel builds (make -j) in this platform, or get a better
  465. compiler."
  466. $run $rm $removelist
  467. exit 1
  468. fi
  469. echo $srcfile > "$lockfile"
  470. fi
  471. if test -n "$fix_srcfile_path"; then
  472. eval srcfile=\"$fix_srcfile_path\"
  473. fi
  474. # Only build a PIC object if we are building libtool libraries.
  475. if test "$build_libtool_libs" = yes; then
  476. # Without this assignment, base_compile gets emptied.
  477. fbsd_hideous_sh_bug=$base_compile
  478. if test "$pic_mode" != no; then
  479. # All platforms use -DPIC, to notify preprocessed assembler code.
  480. command="$base_compile $srcfile $pic_flag -DPIC"
  481. else
  482. # Don't build PIC code
  483. command="$base_compile $srcfile"
  484. fi
  485. if test "$build_old_libs" = yes; then
  486. lo_libobj="$libobj"
  487. dir=`$echo "X$libobj" | $Xsed -e 's%/[^/]*$%%'`
  488. if test "X$dir" = "X$libobj"; then
  489. dir="$objdir"
  490. else
  491. dir="$dir/$objdir"
  492. fi
  493. libobj="$dir/"`$echo "X$libobj" | $Xsed -e 's%^.*/%%'`
  494. if test -d "$dir"; then
  495. $show "$rm $libobj"
  496. $run $rm $libobj
  497. else
  498. $show "$mkdir $dir"
  499. $run $mkdir $dir
  500. status=$?
  501. if test $status -ne 0 && test ! -d $dir; then
  502. exit $status
  503. fi
  504. fi
  505. fi
  506. if test "$compiler_o_lo" = yes; then
  507. output_obj="$libobj"
  508. command="$command -o $output_obj"
  509. elif test "$compiler_c_o" = yes; then
  510. output_obj="$obj"
  511. command="$command -o $output_obj"
  512. fi
  513. $run $rm "$output_obj"
  514. $show "$command"
  515. if $run eval "$command"; then :
  516. else
  517. test -n "$output_obj" && $run $rm $removelist
  518. exit 1
  519. fi
  520. if test "$need_locks" = warn &&
  521. test x"`cat $lockfile 2>/dev/null`" != x"$srcfile"; then
  522. echo "\
  523. *** ERROR, $lockfile contains:
  524. `cat $lockfile 2>/dev/null`
  525. but it should contain:
  526. $srcfile
  527. This indicates that another process is trying to use the same
  528. temporary object file, and libtool could not work around it because
  529. your compiler does not support \`-c' and \`-o' together. If you
  530. repeat this compilation, it may succeed, by chance, but you had better
  531. avoid parallel builds (make -j) in this platform, or get a better
  532. compiler."
  533. $run $rm $removelist
  534. exit 1
  535. fi
  536. # Just move the object if needed, then go on to compile the next one
  537. if test x"$output_obj" != x"$libobj"; then
  538. $show "$mv $output_obj $libobj"
  539. if $run $mv $output_obj $libobj; then :
  540. else
  541. error=$?
  542. $run $rm $removelist
  543. exit $error
  544. fi
  545. fi
  546. # If we have no pic_flag, then copy the object into place and finish.
  547. if (test -z "$pic_flag" || test "$pic_mode" != default) &&
  548. test "$build_old_libs" = yes; then
  549. # Rename the .lo from within objdir to obj
  550. if test -f $obj; then
  551. $show $rm $obj
  552. $run $rm $obj
  553. fi
  554. $show "$mv $libobj $obj"
  555. if $run $mv $libobj $obj; then :
  556. else
  557. error=$?
  558. $run $rm $removelist
  559. exit $error
  560. fi
  561. xdir=`$echo "X$obj" | $Xsed -e 's%/[^/]*$%%'`
  562. if test "X$xdir" = "X$obj"; then
  563. xdir="."
  564. else
  565. xdir="$xdir"
  566. fi
  567. baseobj=`$echo "X$obj" | $Xsed -e "s%.*/%%"`
  568. libobj=`$echo "X$baseobj" | $Xsed -e "$o2lo"`
  569. # Now arrange that obj and lo_libobj become the same file
  570. $show "(cd $xdir && $LN_S $baseobj $libobj)"
  571. if $run eval '(cd $xdir && $LN_S $baseobj $libobj)'; then
  572. # Unlock the critical section if it was locked
  573. if test "$need_locks" != no; then
  574. $run $rm "$lockfile"
  575. fi
  576. exit 0
  577. else
  578. error=$?
  579. $run $rm $removelist
  580. exit $error
  581. fi
  582. fi
  583. # Allow error messages only from the first compilation.
  584. suppress_output=' >/dev/null 2>&1'
  585. fi
  586. # Only build a position-dependent object if we build old libraries.
  587. if test "$build_old_libs" = yes; then
  588. if test "$pic_mode" != yes; then
  589. # Don't build PIC code
  590. command="$base_compile $srcfile"
  591. else
  592. # All platforms use -DPIC, to notify preprocessed assembler code.
  593. command="$base_compile $srcfile $pic_flag -DPIC"
  594. fi
  595. if test "$compiler_c_o" = yes; then
  596. command="$command -o $obj"
  597. output_obj="$obj"
  598. fi
  599. # Suppress compiler output if we already did a PIC compilation.
  600. command="$command$suppress_output"
  601. $run $rm "$output_obj"
  602. $show "$command"
  603. if $run eval "$command"; then :
  604. else
  605. $run $rm $removelist
  606. exit 1
  607. fi
  608. if test "$need_locks" = warn &&
  609. test x"`cat $lockfile 2>/dev/null`" != x"$srcfile"; then
  610. echo "\
  611. *** ERROR, $lockfile contains:
  612. `cat $lockfile 2>/dev/null`
  613. but it should contain:
  614. $srcfile
  615. This indicates that another process is trying to use the same
  616. temporary object file, and libtool could not work around it because
  617. your compiler does not support \`-c' and \`-o' together. If you
  618. repeat this compilation, it may succeed, by chance, but you had better
  619. avoid parallel builds (make -j) in this platform, or get a better
  620. compiler."
  621. $run $rm $removelist
  622. exit 1
  623. fi
  624. # Just move the object if needed
  625. if test x"$output_obj" != x"$obj"; then
  626. $show "$mv $output_obj $obj"
  627. if $run $mv $output_obj $obj; then :
  628. else
  629. error=$?
  630. $run $rm $removelist
  631. exit $error
  632. fi
  633. fi
  634. # Create an invalid libtool object if no PIC, so that we do not
  635. # accidentally link it into a program.
  636. if test "$build_libtool_libs" != yes; then
  637. $show "echo timestamp > $libobj"
  638. $run eval "echo timestamp > \$libobj" || exit $?
  639. else
  640. # Move the .lo from within objdir
  641. $show "$mv $libobj $lo_libobj"
  642. if $run $mv $libobj $lo_libobj; then :
  643. else
  644. error=$?
  645. $run $rm $removelist
  646. exit $error
  647. fi
  648. fi
  649. fi
  650. # Unlock the critical section if it was locked
  651. if test "$need_locks" != no; then
  652. $run $rm "$lockfile"
  653. fi
  654. exit 0
  655. ;;
  656. # libtool link mode
  657. link | relink)
  658. modename="$modename: link"
  659. case $host in
  660. *-*-cygwin* | *-*-mingw* | *-*-pw32* | *-*-os2*)
  661. # It is impossible to link a dll without this setting, and
  662. # we shouldn't force the makefile maintainer to figure out
  663. # which system we are compiling for in order to pass an extra
  664. # flag for every libtool invokation.
  665. # allow_undefined=no
  666. # FIXME: Unfortunately, there are problems with the above when trying
  667. # to make a dll which has undefined symbols, in which case not
  668. # even a static library is built. For now, we need to specify
  669. # -no-undefined on the libtool link line when we can be certain
  670. # that all symbols are satisfied, otherwise we get a static library.
  671. allow_undefined=yes
  672. ;;
  673. *)
  674. allow_undefined=yes
  675. ;;
  676. esac
  677. libtool_args="$nonopt"
  678. compile_command="$nonopt"
  679. finalize_command="$nonopt"
  680. compile_rpath=
  681. finalize_rpath=
  682. compile_shlibpath=
  683. finalize_shlibpath=
  684. convenience=
  685. old_convenience=
  686. deplibs=
  687. old_deplibs=
  688. compiler_flags=
  689. linker_flags=
  690. dllsearchpath=
  691. lib_search_path=`pwd`
  692. inst_prefix_dir=
  693. avoid_version=no
  694. dlfiles=
  695. dlprefiles=
  696. dlself=no
  697. export_dynamic=no
  698. export_symbols=
  699. export_symbols_regex=
  700. generated=
  701. libobjs=
  702. ltlibs=
  703. module=no
  704. no_install=no
  705. objs=
  706. prefer_static_libs=no
  707. preload=no
  708. prev=
  709. prevarg=
  710. release=
  711. rpath=
  712. xrpath=
  713. perm_rpath=
  714. temp_rpath=
  715. thread_safe=no
  716. vinfo=
  717. # We need to know -static, to get the right output filenames.
  718. for arg
  719. do
  720. case $arg in
  721. -all-static | -static)
  722. if test "X$arg" = "X-all-static"; then
  723. if test "$build_libtool_libs" = yes && test -z "$link_static_flag"; then
  724. $echo "$modename: warning: complete static linking is impossible in this configuration" 1>&2
  725. fi
  726. if test -n "$link_static_flag"; then
  727. dlopen_self=$dlopen_self_static
  728. fi
  729. else
  730. if test -z "$pic_flag" && test -n "$link_static_flag"; then
  731. dlopen_self=$dlopen_self_static
  732. fi
  733. fi
  734. build_libtool_libs=no
  735. build_old_libs=yes
  736. prefer_static_libs=yes
  737. break
  738. ;;
  739. esac
  740. done
  741. # See if our shared archives depend on static archives.
  742. test -n "$old_archive_from_new_cmds" && build_old_libs=yes
  743. # Go through the arguments, transforming them on the way.
  744. while test $# -gt 0; do
  745. arg="$1"
  746. shift
  747. case $arg in
  748. *[\[\~\#\^\&\*\(\)\{\}\|\;\<\>\?\'\ \ ]*|*]*|"")
  749. qarg=\"`$echo "X$arg" | $Xsed -e "$sed_quote_subst"`\" ### testsuite: skip nested quoting test
  750. ;;
  751. *) qarg=$arg ;;
  752. esac
  753. libtool_args="$libtool_args $qarg"
  754. # If the previous option needs an argument, assign it.
  755. if test -n "$prev"; then
  756. case $prev in
  757. output)
  758. compile_command="$compile_command @OUTPUT@"
  759. finalize_command="$finalize_command @OUTPUT@"
  760. ;;
  761. esac
  762. case $prev in
  763. dlfiles|dlprefiles)
  764. if test "$preload" = no; then
  765. # Add the symbol object into the linking commands.
  766. compile_command="$compile_command @SYMFILE@"
  767. finalize_command="$finalize_command @SYMFILE@"
  768. preload=yes
  769. fi
  770. case $arg in
  771. *.la | *.lo) ;; # We handle these cases below.
  772. force)
  773. if test "$dlself" = no; then
  774. dlself=needless
  775. export_dynamic=yes
  776. fi
  777. prev=
  778. continue
  779. ;;
  780. self)
  781. if test "$prev" = dlprefiles; then
  782. dlself=yes
  783. elif test "$prev" = dlfiles && test "$dlopen_self" != yes; then
  784. dlself=yes
  785. else
  786. dlself=needless
  787. export_dynamic=yes
  788. fi
  789. prev=
  790. continue
  791. ;;
  792. *)
  793. if test "$prev" = dlfiles; then
  794. dlfiles="$dlfiles $arg"
  795. else
  796. dlprefiles="$dlprefiles $arg"
  797. fi
  798. prev=
  799. continue
  800. ;;
  801. esac
  802. ;;
  803. expsyms)
  804. export_symbols="$arg"
  805. if test ! -f "$arg"; then
  806. $echo "$modename: symbol file \`$arg' does not exist"
  807. exit 1
  808. fi
  809. prev=
  810. continue
  811. ;;
  812. expsyms_regex)
  813. export_symbols_regex="$arg"
  814. prev=
  815. continue
  816. ;;
  817. inst_prefix)
  818. inst_prefix_dir="$arg"
  819. prev=
  820. continue
  821. ;;
  822. release)
  823. release="-$arg"
  824. prev=
  825. continue
  826. ;;
  827. rpath | xrpath)
  828. # We need an absolute path.
  829. case $arg in
  830. [\\/]* | [A-Za-z]:[\\/]*) ;;
  831. *)
  832. $echo "$modename: only absolute run-paths are allowed" 1>&2
  833. exit 1
  834. ;;
  835. esac
  836. if test "$prev" = rpath; then
  837. case "$rpath " in
  838. *" $arg "*) ;;
  839. *) rpath="$rpath $arg" ;;
  840. esac
  841. else
  842. case "$xrpath " in
  843. *" $arg "*) ;;
  844. *) xrpath="$xrpath $arg" ;;
  845. esac
  846. fi
  847. prev=
  848. continue
  849. ;;
  850. xcompiler)
  851. compiler_flags="$compiler_flags $qarg"
  852. prev=
  853. compile_command="$compile_command $qarg"
  854. finalize_command="$finalize_command $qarg"
  855. continue
  856. ;;
  857. xlinker)
  858. linker_flags="$linker_flags $qarg"
  859. compiler_flags="$compiler_flags $wl$qarg"
  860. prev=
  861. compile_command="$compile_command $wl$qarg"
  862. finalize_command="$finalize_command $wl$qarg"
  863. continue
  864. ;;
  865. *)
  866. eval "$prev=\"\$arg\""
  867. prev=
  868. continue
  869. ;;
  870. esac
  871. fi # test -n $prev
  872. prevarg="$arg"
  873. case $arg in
  874. -all-static)
  875. if test -n "$link_static_flag"; then
  876. compile_command="$compile_command $link_static_flag"
  877. finalize_command="$finalize_command $link_static_flag"
  878. fi
  879. continue
  880. ;;
  881. -allow-undefined)
  882. # FIXME: remove this flag sometime in the future.
  883. $echo "$modename: \`-allow-undefined' is deprecated because it is the default" 1>&2
  884. continue
  885. ;;
  886. -avoid-version)
  887. avoid_version=yes
  888. continue
  889. ;;
  890. -dlopen)
  891. prev=dlfiles
  892. continue
  893. ;;
  894. -dlpreopen)
  895. prev=dlprefiles
  896. continue
  897. ;;
  898. -export-dynamic)
  899. export_dynamic=yes
  900. continue
  901. ;;
  902. -export-symbols | -export-symbols-regex)
  903. if test -n "$export_symbols" || test -n "$export_symbols_regex"; then
  904. $echo "$modename: more than one -exported-symbols argument is not allowed"
  905. exit 1
  906. fi
  907. if test "X$arg" = "X-export-symbols"; then
  908. prev=expsyms
  909. else
  910. prev=expsyms_regex
  911. fi
  912. continue
  913. ;;
  914. -inst-prefix-dir)
  915. prev=inst_prefix
  916. continue
  917. ;;
  918. # The native IRIX linker understands -LANG:*, -LIST:* and -LNO:*
  919. # so, if we see these flags be careful not to treat them like -L
  920. -L[A-Z][A-Z]*:*)
  921. case $with_gcc/$host in
  922. no/*-*-irix* | no/*-*-nonstopux*)
  923. compile_command="$compile_command $arg"
  924. finalize_command="$finalize_command $arg"
  925. ;;
  926. esac
  927. continue
  928. ;;
  929. -L*)
  930. dir=`$echo "X$arg" | $Xsed -e 's/^-L//'`
  931. # We need an absolute path.
  932. case $dir in
  933. [\\/]* | [A-Za-z]:[\\/]*) ;;
  934. *)
  935. absdir=`cd "$dir" && pwd`
  936. if test -z "$absdir"; then
  937. $echo "$modename: cannot determine absolute directory name of \`$dir'" 1>&2
  938. exit 1
  939. fi
  940. dir="$absdir"
  941. ;;
  942. esac
  943. case "$deplibs " in
  944. *" -L$dir "*) ;;
  945. *)
  946. deplibs="$deplibs -L$dir"
  947. lib_search_path="$lib_search_path $dir"
  948. ;;
  949. esac
  950. case $host in
  951. *-*-cygwin* | *-*-mingw* | *-*-pw32* | *-*-os2*)
  952. case :$dllsearchpath: in
  953. *":$dir:"*) ;;
  954. *) dllsearchpath="$dllsearchpath:$dir";;
  955. esac
  956. ;;
  957. esac
  958. continue
  959. ;;
  960. -l*)
  961. if test "X$arg" = "X-lc" || test "X$arg" = "X-lm"; then
  962. case $host in
  963. *-*-cygwin* | *-*-pw32* | *-*-beos*)
  964. # These systems don't actually have a C or math library (as such)
  965. continue
  966. ;;
  967. *-*-mingw* | *-*-os2*)
  968. # These systems don't actually have a C library (as such)
  969. test "X$arg" = "X-lc" && continue
  970. ;;
  971. *-*-openbsd* | *-*-freebsd*)
  972. # Do not include libc due to us having libc/libc_r.
  973. test "X$arg" = "X-lc" && continue
  974. ;;
  975. esac
  976. elif test "X$arg" = "X-lc_r"; then
  977. case $host in
  978. *-*-openbsd* | *-*-freebsd*)
  979. # Do not include libc_r directly, use -pthread flag.
  980. continue
  981. ;;
  982. esac
  983. fi
  984. deplibs="$deplibs $arg"
  985. continue
  986. ;;
  987. -module)
  988. module=yes
  989. continue
  990. ;;
  991. -no-fast-install)
  992. fast_install=no
  993. continue
  994. ;;
  995. -no-install)
  996. case $host in
  997. *-*-cygwin* | *-*-mingw* | *-*-pw32* | *-*-os2*)
  998. # The PATH hackery in wrapper scripts is required on Windows
  999. # in order for the loader to find any dlls it needs.
  1000. $echo "$modename: warning: \`-no-install' is ignored for $host" 1>&2
  1001. $echo "$modename: warning: assuming \`-no-fast-install' instead" 1>&2
  1002. fast_install=no
  1003. ;;
  1004. *) no_install=yes ;;
  1005. esac
  1006. continue
  1007. ;;
  1008. -no-undefined)
  1009. allow_undefined=no
  1010. continue
  1011. ;;
  1012. -o) prev=output ;;
  1013. -release)
  1014. prev=release
  1015. continue
  1016. ;;
  1017. -rpath)
  1018. prev=rpath
  1019. continue
  1020. ;;
  1021. -R)
  1022. prev=xrpath
  1023. continue
  1024. ;;
  1025. -R*)
  1026. dir=`$echo "X$arg" | $Xsed -e 's/^-R//'`
  1027. # We need an absolute path.
  1028. case $dir in
  1029. [\\/]* | [A-Za-z]:[\\/]*) ;;
  1030. *)
  1031. $echo "$modename: only absolute run-paths are allowed" 1>&2
  1032. exit 1
  1033. ;;
  1034. esac
  1035. case "$xrpath " in
  1036. *" $dir "*) ;;
  1037. *) xrpath="$xrpath $dir" ;;
  1038. esac
  1039. continue
  1040. ;;
  1041. -static)
  1042. # The effects of -static are defined in a previous loop.
  1043. # We used to do the same as -all-static on platforms that
  1044. # didn't have a PIC flag, but the assumption that the effects
  1045. # would be equivalent was wrong. It would break on at least
  1046. # Digital Unix and AIX.
  1047. continue
  1048. ;;
  1049. -thread-safe)
  1050. thread_safe=yes
  1051. continue
  1052. ;;
  1053. -version-info)
  1054. prev=vinfo
  1055. continue
  1056. ;;
  1057. -Wc,*)
  1058. args=`$echo "X$arg" | $Xsed -e "$sed_quote_subst" -e 's/^-Wc,//'`
  1059. arg=
  1060. save_ifs="$IFS"; IFS=','
  1061. for flag in $args; do
  1062. IFS="$save_ifs"
  1063. case $flag in
  1064. *[\[\~\#\^\&\*\(\)\{\}\|\;\<\>\?\'\ \ ]*|*]*|"")
  1065. flag="\"$flag\""
  1066. ;;
  1067. esac
  1068. arg="$arg $wl$flag"
  1069. compiler_flags="$compiler_flags $flag"
  1070. done
  1071. IFS="$save_ifs"
  1072. arg=`$echo "X$arg" | $Xsed -e "s/^ //"`
  1073. ;;
  1074. -Wl,*)
  1075. args=`$echo "X$arg" | $Xsed -e "$sed_quote_subst" -e 's/^-Wl,//'`
  1076. arg=
  1077. save_ifs="$IFS"; IFS=','
  1078. for flag in $args; do
  1079. IFS="$save_ifs"
  1080. case $flag in
  1081. *[\[\~\#\^\&\*\(\)\{\}\|\;\<\>\?\'\ \ ]*|*]*|"")
  1082. flag="\"$flag\""
  1083. ;;
  1084. esac
  1085. arg="$arg $wl$flag"
  1086. compiler_flags="$compiler_flags $wl$flag"
  1087. linker_flags="$linker_flags $flag"
  1088. done
  1089. IFS="$save_ifs"
  1090. arg=`$echo "X$arg" | $Xsed -e "s/^ //"`
  1091. ;;
  1092. -Xcompiler)
  1093. prev=xcompiler
  1094. continue
  1095. ;;
  1096. -Xlinker)
  1097. prev=xlinker
  1098. continue
  1099. ;;
  1100. # Some other compiler flag.
  1101. -* | +*)
  1102. # Unknown arguments in both finalize_command and compile_command need
  1103. # to be aesthetically quoted because they are evaled later.
  1104. arg=`$echo "X$arg" | $Xsed -e "$sed_quote_subst"`
  1105. case $arg in
  1106. *[\[\~\#\^\&\*\(\)\{\}\|\;\<\>\?\'\ \ ]*|*]*|"")
  1107. arg="\"$arg\""
  1108. ;;
  1109. esac
  1110. ;;
  1111. *.lo | *.$objext)
  1112. # A library or standard object.
  1113. if test "$prev" = dlfiles; then
  1114. # This file was specified with -dlopen.
  1115. if test "$build_libtool_libs" = yes && test "$dlopen_support" = yes; then
  1116. dlfiles="$dlfiles $arg"
  1117. prev=
  1118. continue
  1119. else
  1120. # If libtool objects are unsupported, then we need to preload.
  1121. prev=dlprefiles
  1122. fi
  1123. fi
  1124. if test "$prev" = dlprefiles; then
  1125. # Preload the old-style object.
  1126. dlprefiles="$dlprefiles "`$echo "X$arg" | $Xsed -e "$lo2o"`
  1127. prev=
  1128. else
  1129. case $arg in
  1130. *.lo) libobjs="$libobjs $arg" ;;
  1131. *) objs="$objs $arg" ;;
  1132. esac
  1133. fi
  1134. ;;
  1135. *.$libext)
  1136. # An archive.
  1137. deplibs="$deplibs $arg"
  1138. old_deplibs="$old_deplibs $arg"
  1139. continue
  1140. ;;
  1141. *.la)
  1142. # A libtool-controlled library.
  1143. if test "$prev" = dlfiles; then
  1144. # This library was specified with -dlopen.
  1145. dlfiles="$dlfiles $arg"
  1146. prev=
  1147. elif test "$prev" = dlprefiles; then
  1148. # The library was specified with -dlpreopen.
  1149. dlprefiles="$dlprefiles $arg"
  1150. prev=
  1151. else
  1152. deplibs="$deplibs $arg"
  1153. fi
  1154. continue
  1155. ;;
  1156. # Some other compiler argument.
  1157. *)
  1158. # Unknown arguments in both finalize_command and compile_command need
  1159. # to be aesthetically quoted because they are evaled later.
  1160. arg=`$echo "X$arg" | $Xsed -e "$sed_quote_subst"`
  1161. case $arg in
  1162. *[\[\~\#\^\&\*\(\)\{\}\|\;\<\>\?\'\ \ ]*|*]*|"")
  1163. arg="\"$arg\""
  1164. ;;
  1165. esac
  1166. ;;
  1167. esac # arg
  1168. # Now actually substitute the argument into the commands.
  1169. if test -n "$arg"; then
  1170. compile_command="$compile_command $arg"
  1171. finalize_command="$finalize_command $arg"
  1172. fi
  1173. done # argument parsing loop
  1174. if test -n "$prev"; then
  1175. $echo "$modename: the \`$prevarg' option requires an argument" 1>&2
  1176. $echo "$help" 1>&2
  1177. exit 1
  1178. fi
  1179. if test "$export_dynamic" = yes && test -n "$export_dynamic_flag_spec"; then
  1180. eval arg=\"$export_dynamic_flag_spec\"
  1181. compile_command="$compile_command $arg"
  1182. finalize_command="$finalize_command $arg"
  1183. fi
  1184. # calculate the name of the file, without its directory
  1185. outputname=`$echo "X$output" | $Xsed -e 's%^.*/%%'`
  1186. libobjs_save="$libobjs"
  1187. if test -n "$shlibpath_var"; then
  1188. # get the directories listed in $shlibpath_var
  1189. eval shlib_search_path=\`\$echo \"X\${$shlibpath_var}\" \| \$Xsed -e \'s/:/ /g\'\`
  1190. else
  1191. shlib_search_path=
  1192. fi
  1193. eval sys_lib_search_path=\"$sys_lib_search_path_spec\"
  1194. eval sys_lib_dlsearch_path=\"$sys_lib_dlsearch_path_spec\"
  1195. output_objdir=`$echo "X$output" | $Xsed -e 's%/[^/]*$%%'`
  1196. if test "X$output_objdir" = "X$output"; then
  1197. output_objdir="$objdir"
  1198. else
  1199. output_objdir="$output_objdir/$objdir"
  1200. fi
  1201. # Create the object directory.
  1202. if test ! -d $output_objdir; then
  1203. $show "$mkdir $output_objdir"
  1204. $run $mkdir $output_objdir
  1205. status=$?
  1206. if test $status -ne 0 && test ! -d $output_objdir; then
  1207. exit $status
  1208. fi
  1209. fi
  1210. # Determine the type of output
  1211. case $output in
  1212. "")
  1213. $echo "$modename: you must specify an output file" 1>&2
  1214. $echo "$help" 1>&2
  1215. exit 1
  1216. ;;
  1217. *.$libext) linkmode=oldlib ;;
  1218. *.lo | *.$objext) linkmode=obj ;;
  1219. *.la) linkmode=lib ;;
  1220. *) linkmode=prog ;; # Anything else should be a program.
  1221. esac
  1222. specialdeplibs=
  1223. libs=
  1224. # Find all interdependent deplibs by searching for libraries
  1225. # that are linked more than once (e.g. -la -lb -la)
  1226. for deplib in $deplibs; do
  1227. if test "X$duplicate_deps" = "Xyes" ; then
  1228. case "$libs " in
  1229. *" $deplib "*) specialdeplibs="$specialdeplibs $deplib" ;;
  1230. esac
  1231. fi
  1232. libs="$libs $deplib"
  1233. done
  1234. deplibs=
  1235. newdependency_libs=
  1236. newlib_search_path=
  1237. need_relink=no # whether we're linking any uninstalled libtool libraries
  1238. notinst_deplibs= # not-installed libtool libraries
  1239. notinst_path= # paths that contain not-installed libtool libraries
  1240. case $linkmode in
  1241. lib)
  1242. passes="conv link"
  1243. for file in $dlfiles $dlprefiles; do
  1244. case $file in
  1245. *.la) ;;
  1246. *)
  1247. $echo "$modename: libraries can \`-dlopen' only libtool libraries: $file" 1>&2
  1248. exit 1
  1249. ;;
  1250. esac
  1251. done
  1252. ;;
  1253. prog)
  1254. compile_deplibs=
  1255. finalize_deplibs=
  1256. alldeplibs=no
  1257. newdlfiles=
  1258. newdlprefiles=
  1259. passes="conv scan dlopen dlpreopen link"
  1260. ;;
  1261. *) passes="conv"
  1262. ;;
  1263. esac
  1264. for pass in $passes; do
  1265. if test $linkmode = prog; then
  1266. # Determine which files to process
  1267. case $pass in
  1268. dlopen)
  1269. libs="$dlfiles"
  1270. save_deplibs="$deplibs" # Collect dlpreopened libraries
  1271. deplibs=
  1272. ;;
  1273. dlpreopen) libs="$dlprefiles" ;;
  1274. link) libs="$deplibs %DEPLIBS% $dependency_libs" ;;
  1275. esac
  1276. fi
  1277. for deplib in $libs; do
  1278. lib=
  1279. found=no
  1280. case $deplib in
  1281. -l*)
  1282. if test $linkmode = oldlib && test $linkmode = obj; then
  1283. $echo "$modename: warning: \`-l' is ignored for archives/objects: $deplib" 1>&2
  1284. continue
  1285. fi
  1286. if test $pass = conv; then
  1287. deplibs="$deplib $deplibs"
  1288. continue
  1289. fi
  1290. name=`$echo "X$deplib" | $Xsed -e 's/^-l//'`
  1291. for searchdir in $newlib_search_path $lib_search_path $sys_lib_search_path $shlib_search_path; do
  1292. # Search the libtool library
  1293. lib="$searchdir/lib${name}.la"
  1294. if test -f "$lib"; then
  1295. found=yes
  1296. break
  1297. fi
  1298. done
  1299. if test "$found" != yes; then
  1300. # deplib doesn't seem to be a libtool library
  1301. if test "$linkmode,$pass" = "prog,link"; then
  1302. compile_deplibs="$deplib $compile_deplibs"
  1303. finalize_deplibs="$deplib $finalize_deplibs"
  1304. else
  1305. deplibs="$deplib $deplibs"
  1306. test $linkmode = lib && newdependency_libs="$deplib $newdependency_libs"
  1307. fi
  1308. continue
  1309. fi
  1310. ;; # -l
  1311. -L*)
  1312. case $linkmode in
  1313. lib)
  1314. deplibs="$deplib $deplibs"
  1315. test $pass = conv && continue
  1316. newdependency_libs="$deplib $newdependency_libs"
  1317. newlib_search_path="$newlib_search_path "`$echo "X$deplib" | $Xsed -e 's/^-L//'`
  1318. ;;
  1319. prog)
  1320. if test $pass = conv; then
  1321. deplibs="$deplib $deplibs"
  1322. continue
  1323. fi
  1324. if test $pass = scan; then
  1325. deplibs="$deplib $deplibs"
  1326. newlib_search_path="$newlib_search_path "`$echo "X$deplib" | $Xsed -e 's/^-L//'`
  1327. else
  1328. compile_deplibs="$deplib $compile_deplibs"
  1329. finalize_deplibs="$deplib $finalize_deplibs"
  1330. fi
  1331. ;;
  1332. *)
  1333. $echo "$modename: warning: \`-L' is ignored for archives/objects: $deplib" 1>&2
  1334. ;;
  1335. esac # linkmode
  1336. continue
  1337. ;; # -L
  1338. -R*)
  1339. if test $pass = link; then
  1340. dir=`$echo "X$deplib" | $Xsed -e 's/^-R//'`
  1341. # Make sure the xrpath contains only unique directories.
  1342. case "$xrpath " in
  1343. *" $dir "*) ;;
  1344. *) xrpath="$xrpath $dir" ;;
  1345. esac
  1346. fi
  1347. deplibs="$deplib $deplibs"
  1348. continue
  1349. ;;
  1350. *.la) lib="$deplib" ;;
  1351. *.$libext)
  1352. if test $pass = conv; then
  1353. deplibs="$deplib $deplibs"
  1354. continue
  1355. fi
  1356. case $linkmode in
  1357. lib)
  1358. if test "$deplibs_check_method" != pass_all; then
  1359. echo
  1360. echo "*** Warning: Trying to link with static lib archive $deplib."
  1361. echo "*** I have the capability to make that library automatically link in when"
  1362. echo "*** you link to this library. But I can only do this if you have a"
  1363. echo "*** shared version of the library, which you do not appear to have"
  1364. echo "*** because the file extensions .$libext of this argument makes me believe"
  1365. echo "*** that it is just a static archive that I should not used here."
  1366. else
  1367. echo
  1368. echo "*** Warning: Linking the shared library $output against the"
  1369. echo "*** static library $deplib is not portable!"
  1370. deplibs="$deplib $deplibs"
  1371. fi
  1372. continue
  1373. ;;
  1374. prog)
  1375. if test $pass != link; then
  1376. deplibs="$deplib $deplibs"
  1377. else
  1378. compile_deplibs="$deplib $compile_deplibs"
  1379. finalize_deplibs="$deplib $finalize_deplibs"
  1380. fi
  1381. continue
  1382. ;;
  1383. esac # linkmode
  1384. ;; # *.$libext
  1385. *.lo | *.$objext)
  1386. if test $pass = dlpreopen || test "$dlopen_support" != yes || test "$build_libtool_libs" = no; then
  1387. # If there is no dlopen support or we're linking statically,
  1388. # we need to preload.
  1389. newdlprefiles="$newdlprefiles $deplib"
  1390. compile_deplibs="$deplib $compile_deplibs"
  1391. finalize_deplibs="$deplib $finalize_deplibs"
  1392. else
  1393. newdlfiles="$newdlfiles $deplib"
  1394. fi
  1395. continue
  1396. ;;
  1397. %DEPLIBS%)
  1398. alldeplibs=yes
  1399. continue
  1400. ;;
  1401. esac # case $deplib
  1402. if test $found = yes || test -f "$lib"; then :
  1403. else
  1404. $echo "$modename: cannot find the library \`$lib'" 1>&2
  1405. exit 1
  1406. fi
  1407. # Check to see that this really is a libtool archive.
  1408. if (${SED} -e '2q' $lib | egrep "^# Generated by .*$PACKAGE") >/dev/null 2>&1; then :
  1409. else
  1410. $echo "$modename: \`$lib' is not a valid libtool archive" 1>&2
  1411. exit 1
  1412. fi
  1413. ladir=`$echo "X$lib" | $Xsed -e 's%/[^/]*$%%'`
  1414. test "X$ladir" = "X$lib" && ladir="."
  1415. dlname=
  1416. dlopen=
  1417. dlpreopen=
  1418. libdir=
  1419. library_names=
  1420. old_library=
  1421. # If the library was installed with an old release of libtool,
  1422. # it will not redefine variable installed.
  1423. installed=yes
  1424. # Read the .la file
  1425. case $lib in
  1426. */* | *\\*) . $lib ;;
  1427. *) . ./$lib ;;
  1428. esac
  1429. if test "$linkmode,$pass" = "lib,link" ||
  1430. test "$linkmode,$pass" = "prog,scan" ||
  1431. { test $linkmode = oldlib && test $linkmode = obj; }; then
  1432. # Add dl[pre]opened files of deplib
  1433. test -n "$dlopen" && dlfiles="$dlfiles $dlopen"
  1434. test -n "$dlpreopen" && dlprefiles="$dlprefiles $dlpreopen"
  1435. fi
  1436. if test $pass = conv; then
  1437. # Only check for convenience libraries
  1438. deplibs="$lib $deplibs"
  1439. if test -z "$libdir"; then
  1440. if test -z "$old_library"; then
  1441. $echo "$modename: cannot find name of link library for \`$lib'" 1>&2
  1442. exit 1
  1443. fi
  1444. # It is a libtool convenience library, so add in its objects.
  1445. convenience="$convenience $ladir/$objdir/$old_library"
  1446. old_convenience="$old_convenience $ladir/$objdir/$old_library"
  1447. tmp_libs=
  1448. for deplib in $dependency_libs; do
  1449. deplibs="$deplib $deplibs"
  1450. if test "X$duplicate_deps" = "Xyes" ; then
  1451. case "$tmp_libs " in
  1452. *" $deplib "*) specialdeplibs="$specialdeplibs $deplib" ;;
  1453. esac
  1454. fi
  1455. tmp_libs="$tmp_libs $deplib"
  1456. done
  1457. elif test $linkmode != prog && test $linkmode != lib; then
  1458. $echo "$modename: \`$lib' is not a convenience library" 1>&2
  1459. exit 1
  1460. fi
  1461. continue
  1462. fi # $pass = conv
  1463. # Get the name of the library we link against.
  1464. linklib=
  1465. for l in $old_library $library_names; do
  1466. linklib="$l"
  1467. done
  1468. if test -z "$linklib"; then
  1469. $echo "$modename: cannot find name of link library for \`$lib'" 1>&2
  1470. exit 1
  1471. fi
  1472. # This library was specified with -dlopen.
  1473. if test $pass = dlopen; then
  1474. if test -z "$libdir"; then
  1475. $echo "$modename: cannot -dlopen a convenience library: \`$lib'" 1>&2
  1476. exit 1
  1477. fi
  1478. if test -z "$dlname" || test "$dlopen_support" != yes || test "$build_libtool_libs" = no; then
  1479. # If there is no dlname, no dlopen support or we're linking
  1480. # statically, we need to preload.
  1481. dlprefiles="$dlprefiles $lib"
  1482. else
  1483. newdlfiles="$newdlfiles $lib"
  1484. fi
  1485. continue
  1486. fi # $pass = dlopen
  1487. # We need an absolute path.
  1488. case $ladir in
  1489. [\\/]* | [A-Za-z]:[\\/]*) abs_ladir="$ladir" ;;
  1490. *)
  1491. abs_ladir=`cd "$ladir" && pwd`
  1492. if test -z "$abs_ladir"; then
  1493. $echo "$modename: warning: cannot determine absolute directory name of \`$ladir'" 1>&2
  1494. $echo "$modename: passing it literally to the linker, although it might fail" 1>&2
  1495. abs_ladir="$ladir"
  1496. fi
  1497. ;;
  1498. esac
  1499. laname=`$echo "X$lib" | $Xsed -e 's%^.*/%%'`
  1500. # Find the relevant object directory and library name.
  1501. if test "X$installed" = Xyes; then
  1502. if test ! -f "$libdir/$linklib" && test -f "$abs_ladir/$linklib"; then
  1503. $echo "$modename: warning: library \`$lib' was moved." 1>&2
  1504. dir="$ladir"
  1505. absdir="$abs_ladir"
  1506. libdir="$abs_ladir"
  1507. else
  1508. dir="$libdir"
  1509. absdir="$libdir"
  1510. fi
  1511. else
  1512. dir="$ladir/$objdir"
  1513. absdir="$abs_ladir/$objdir"
  1514. # Remove this search path later
  1515. notinst_path="$notinst_path $abs_ladir"
  1516. fi # $installed = yes
  1517. name=`$echo "X$laname" | $Xsed -e 's/\.la$//' -e 's/^lib//'`
  1518. # This library was specified with -dlpreopen.
  1519. if test $pass = dlpreopen; then
  1520. if test -z "$libdir"; then
  1521. $echo "$modename: cannot -dlpreopen a convenience library: \`$lib'" 1>&2
  1522. exit 1
  1523. fi
  1524. # Prefer using a static library (so that no silly _DYNAMIC symbols
  1525. # are required to link).
  1526. if test -n "$old_library"; then
  1527. newdlprefiles="$newdlprefiles $dir/$old_library"
  1528. # Otherwise, use the dlname, so that lt_dlopen finds it.
  1529. elif test -n "$dlname"; then
  1530. newdlprefiles="$newdlprefiles $dir/$dlname"
  1531. else
  1532. newdlprefiles="$newdlprefiles $dir/$linklib"
  1533. fi
  1534. fi # $pass = dlpreopen
  1535. if test -z "$libdir"; then
  1536. # Link the convenience library
  1537. if test $linkmode = lib; then
  1538. deplibs="$dir/$old_library $deplibs"
  1539. elif test "$linkmode,$pass" = "prog,link"; then
  1540. compile_deplibs="$dir/$old_library $compile_deplibs"
  1541. finalize_deplibs="$dir/$old_library $finalize_deplibs"
  1542. else
  1543. deplibs="$lib $deplibs"
  1544. fi
  1545. continue
  1546. fi
  1547. if test $linkmode = prog && test $pass != link; then
  1548. newlib_search_path="$newlib_search_path $ladir"
  1549. deplibs="$lib $deplibs"
  1550. linkalldeplibs=no
  1551. if test "$link_all_deplibs" != no || test -z "$library_names" ||
  1552. test "$build_libtool_libs" = no; then
  1553. linkalldeplibs=yes
  1554. fi
  1555. tmp_libs=
  1556. for deplib in $dependency_libs; do
  1557. case $deplib in
  1558. -L*) newlib_search_path="$newlib_search_path "`$echo "X$deplib" | $Xsed -e 's/^-L//'`;; ### testsuite: skip nested quoting test
  1559. esac
  1560. # Need to link against all dependency_libs?
  1561. if test $linkalldeplibs = yes; then
  1562. deplibs="$deplib $deplibs"
  1563. else
  1564. # Need to hardcode shared library paths
  1565. # or/and link against static libraries
  1566. newdependency_libs="$deplib $newdependency_libs"
  1567. fi
  1568. if test "X$duplicate_deps" = "Xyes" ; then
  1569. case "$tmp_libs " in
  1570. *" $deplib "*) specialdeplibs="$specialdeplibs $deplib" ;;
  1571. esac
  1572. fi
  1573. tmp_libs="$tmp_libs $deplib"
  1574. done # for deplib
  1575. continue
  1576. fi # $linkmode = prog...
  1577. link_static=no # Whether the deplib will be linked statically
  1578. if test -n "$library_names" &&
  1579. { test "$prefer_static_libs" = no || test -z "$old_library"; }; then
  1580. # Link against this shared library
  1581. if test "$linkmode,$pass" = "prog,link" ||
  1582. { test $linkmode = lib && test $hardcode_into_libs = yes; }; then
  1583. # Hardcode the library path.
  1584. # Skip directories that are in the system default run-time
  1585. # search path.
  1586. case " $sys_lib_dlsearch_path " in
  1587. *" $absdir "*) ;;
  1588. *)
  1589. case "$compile_rpath " in
  1590. *" $absdir "*) ;;
  1591. *) compile_rpath="$compile_rpath $absdir"
  1592. esac
  1593. ;;
  1594. esac
  1595. case " $sys_lib_dlsearch_path " in
  1596. *" $libdir "*) ;;
  1597. *)
  1598. case "$finalize_rpath " in
  1599. *" $libdir "*) ;;
  1600. *) finalize_rpath="$finalize_rpath $libdir"
  1601. esac
  1602. ;;
  1603. esac
  1604. if test $linkmode = prog; then
  1605. # We need to hardcode the library path
  1606. if test -n "$shlibpath_var"; then
  1607. # Make sure the rpath contains only unique directories.
  1608. case "$temp_rpath " in
  1609. *" $dir "*) ;;
  1610. *" $absdir "*) ;;
  1611. *) temp_rpath="$temp_rpath $dir" ;;
  1612. esac
  1613. fi
  1614. fi
  1615. fi # $linkmode,$pass = prog,link...
  1616. if test "$alldeplibs" = yes &&
  1617. { test "$deplibs_check_method" = pass_all ||
  1618. { test "$build_libtool_libs" = yes &&
  1619. test -n "$library_names"; }; }; then
  1620. # We only need to search for static libraries
  1621. continue
  1622. fi
  1623. if test "$installed" = no; then
  1624. notinst_deplibs="$notinst_deplibs $lib"
  1625. need_relink=yes
  1626. fi
  1627. if test -n "$old_archive_from_expsyms_cmds"; then
  1628. # figure out the soname
  1629. set dummy $library_names
  1630. realname="$2"
  1631. shift; shift
  1632. libname=`eval \\$echo \"$libname_spec\"`
  1633. # use dlname if we got it. it's perfectly good, no?
  1634. if test -n "$dlname"; then
  1635. soname="$dlname"
  1636. elif test -n "$soname_spec"; then
  1637. # bleh windows
  1638. case $host in
  1639. *cygwin*)
  1640. major=`expr $current - $age`
  1641. versuffix="-$major"
  1642. ;;
  1643. esac
  1644. eval soname=\"$soname_spec\"
  1645. else
  1646. soname="$realname"
  1647. fi
  1648. # Make a new name for the extract_expsyms_cmds to use
  1649. soroot="$soname"
  1650. soname=`echo $soroot | ${SED} -e 's/^.*\///'`
  1651. newlib="libimp-`echo $soname | ${SED} 's/^lib//;s/\.dll$//'`.a"
  1652. # If the library has no export list, then create one now
  1653. if test -f "$output_objdir/$soname-def"; then :
  1654. else
  1655. $show "extracting exported symbol list from \`$soname'"
  1656. save_ifs="$IFS"; IFS='~'
  1657. eval cmds=\"$extract_expsyms_cmds\"
  1658. for cmd in $cmds; do
  1659. IFS="$save_ifs"
  1660. $show "$cmd"
  1661. $run eval "$cmd" || exit $?
  1662. done
  1663. IFS="$save_ifs"
  1664. fi
  1665. # Create $newlib
  1666. if test -f "$output_objdir/$newlib"; then :; else
  1667. $show "generating import library for \`$soname'"
  1668. save_ifs="$IFS"; IFS='~'
  1669. eval cmds=\"$old_archive_from_expsyms_cmds\"
  1670. for cmd in $cmds; do
  1671. IFS="$save_ifs"
  1672. $show "$cmd"
  1673. $run eval "$cmd" || exit $?
  1674. done
  1675. IFS="$save_ifs"
  1676. fi
  1677. # make sure the library variables are pointing to the new library
  1678. dir=$output_objdir
  1679. linklib=$newlib
  1680. fi # test -n $old_archive_from_expsyms_cmds
  1681. if test $linkmode = prog || test "$mode" != relink; then
  1682. add_shlibpath=
  1683. add_dir=
  1684. add=
  1685. lib_linked=yes
  1686. case $hardcode_action in
  1687. immediate | unsupported)
  1688. if test "$hardcode_direct" = no; then
  1689. add="$dir/$linklib"
  1690. elif test "$hardcode_minus_L" = no; then
  1691. case $host in
  1692. *-*-sunos*) add_shlibpath="$dir" ;;
  1693. esac
  1694. add_dir="-L$dir"
  1695. add="-l$name"
  1696. elif test "$hardcode_shlibpath_var" = no; then
  1697. add_shlibpath="$dir"
  1698. add="-l$name"
  1699. else
  1700. lib_linked=no
  1701. fi
  1702. ;;
  1703. relink)
  1704. if test "$hardcode_direct" = yes; then
  1705. add="$dir/$linklib"
  1706. elif test "$hardcode_minus_L" = yes; then
  1707. add_dir="-L$dir"
  1708. add="-l$name"
  1709. elif test "$hardcode_shlibpath_var" = yes; then
  1710. add_shlibpath="$dir"
  1711. add="-l$name"
  1712. else
  1713. lib_linked=no
  1714. fi
  1715. ;;
  1716. *) lib_linked=no ;;
  1717. esac
  1718. if test "$lib_linked" != yes; then
  1719. $echo "$modename: configuration error: unsupported hardcode properties"
  1720. exit 1
  1721. fi
  1722. if test -n "$add_shlibpath"; then
  1723. case :$compile_shlibpath: in
  1724. *":$add_shlibpath:"*) ;;
  1725. *) compile_shlibpath="$compile_shlibpath$add_shlibpath:" ;;
  1726. esac
  1727. fi
  1728. if test $linkmode = prog; then
  1729. test -n "$add_dir" && compile_deplibs="$add_dir $compile_deplibs"
  1730. test -n "$add" && compile_deplibs="$add $compile_deplibs"
  1731. else
  1732. test -n "$add_dir" && deplibs="$add_dir $deplibs"
  1733. test -n "$add" && deplibs="$add $deplibs"
  1734. if test "$hardcode_direct" != yes && \
  1735. test "$hardcode_minus_L" != yes && \
  1736. test "$hardcode_shlibpath_var" = yes; then
  1737. case :$finalize_shlibpath: in
  1738. *":$libdir:"*) ;;
  1739. *) finalize_shlibpath="$finalize_shlibpath$libdir:" ;;
  1740. esac
  1741. fi
  1742. fi
  1743. fi
  1744. if test $linkmode = prog || test "$mode" = relink; then
  1745. add_shlibpath=
  1746. add_prefix_dir=
  1747. add_dir=
  1748. add=
  1749. # Finalize command for both is simple: just hardcode it.
  1750. if test "$hardcode_direct" = yes; then
  1751. add="$libdir/$linklib"
  1752. elif test "$hardcode_minus_L" = yes; then
  1753. add_dir="-L$libdir"
  1754. add="-l$name"
  1755. elif test "$hardcode_shlibpath_var" = yes; then
  1756. case :$finalize_shlibpath: in
  1757. *":$libdir:"*) ;;
  1758. *) finalize_shlibpath="$finalize_shlibpath$libdir:" ;;
  1759. esac
  1760. add="-l$name"
  1761. else
  1762. # We cannot seem to hardcode it, guess we'll fake it.
  1763. add_dir="-L$libdir"
  1764. add="-l$name"
  1765. fi
  1766. if test -n "$inst_prefix_dir"; then
  1767. case "$libdir" in
  1768. [\\/]*)
  1769. add_prefix_dir="-L$inst_prefix_dir$libdir"
  1770. ;;
  1771. esac
  1772. fi
  1773. # add_prefix_dir must be appended instead, otherwise it can
  1774. # possibly be overrided by any hardcoded -L/... path in deplibs
  1775. if test $linkmode = prog; then
  1776. test -n "$add_prefix_dir" && finalize_deplibs="$finalize_deplibs $add_prefix_dir"
  1777. test -n "$add_dir" && finalize_deplibs="$add_dir $finalize_deplibs"
  1778. test -n "$add" && finalize_deplibs="$add $finalize_deplibs"
  1779. else
  1780. test -n "$add_prefix_dir" && deplibs="$deplibs $add_prefix_dir"
  1781. test -n "$add_dir" && deplibs="$add_dir $deplibs"
  1782. test -n "$add" && deplibs="$add $deplibs"
  1783. fi
  1784. fi
  1785. elif test $linkmode = prog; then
  1786. if test "$alldeplibs" = yes &&
  1787. { test "$deplibs_check_method" = pass_all ||
  1788. { test "$build_libtool_libs" = yes &&
  1789. test -n "$library_names"; }; }; then
  1790. # We only need to search for static libraries
  1791. continue
  1792. fi
  1793. # Try to link the static library
  1794. # Here we assume that one of hardcode_direct or hardcode_minus_L
  1795. # is not unsupported. This is valid on all known static and
  1796. # shared platforms.
  1797. if test "$hardcode_direct" != unsupported; then
  1798. test -n "$old_library" && linklib="$old_library"
  1799. compile_deplibs="$dir/$linklib $compile_deplibs"
  1800. finalize_deplibs="$dir/$linklib $finalize_deplibs"
  1801. else
  1802. compile_deplibs="-l$name -L$dir $compile_deplibs"
  1803. finalize_deplibs="-l$name -L$dir $finalize_deplibs"
  1804. fi
  1805. elif test "$build_libtool_libs" = yes; then
  1806. # Not a shared library
  1807. if test "$deplibs_check_method" != pass_all; then
  1808. # We're trying link a shared library against a static one
  1809. # but the system doesn't support it.
  1810. # Just print a warning and add the library to dependency_libs so
  1811. # that the program can be linked against the static library.
  1812. echo
  1813. echo "*** Warning: This system can not link to static lib archive $lib."
  1814. echo "*** I have the capability to make that library automatically link in when"
  1815. echo "*** you link to this library. But I can only do this if you have a"
  1816. echo "*** shared version of the library, which you do not appear to have."
  1817. if test "$module" = yes; then
  1818. echo "*** But as you try to build a module library, libtool will still create "
  1819. echo "*** a static module, that should work as long as the dlopening application"
  1820. echo "*** is linked with the -dlopen flag to resolve symbols at runtime."
  1821. if test -z "$global_symbol_pipe"; then
  1822. echo
  1823. echo "*** However, this would only work if libtool was able to extract symbol"
  1824. echo "*** lists from a program, using \`nm' or equivalent, but libtool could"
  1825. echo "*** not find such a program. So, this module is probably useless."
  1826. echo "*** \`nm' from GNU binutils and a full rebuild may help."
  1827. fi
  1828. if test "$build_old_libs" = no; then
  1829. build_libtool_libs=module
  1830. build_old_libs=yes
  1831. else
  1832. build_libtool_libs=no
  1833. fi
  1834. fi
  1835. else
  1836. convenience="$convenience $dir/$old_library"
  1837. old_convenience="$old_convenience $dir/$old_library"
  1838. deplibs="$dir/$old_library $deplibs"
  1839. link_static=yes
  1840. fi
  1841. fi # link shared/static library?
  1842. if test $linkmode = lib; then
  1843. if test -n "$dependency_libs" &&
  1844. { test $hardcode_into_libs != yes || test $build_old_libs = yes ||
  1845. test $link_static = yes; }; then
  1846. # Extract -R from dependency_libs
  1847. temp_deplibs=
  1848. for libdir in $dependency_libs; do
  1849. case $libdir in
  1850. -R*) temp_xrpath=`$echo "X$libdir" | $Xsed -e 's/^-R//'`
  1851. case " $xrpath " in
  1852. *" $temp_xrpath "*) ;;
  1853. *) xrpath="$xrpath $temp_xrpath";;
  1854. esac;;
  1855. *) temp_deplibs="$temp_deplibs $libdir";;
  1856. esac
  1857. done
  1858. dependency_libs="$temp_deplibs"
  1859. fi
  1860. newlib_search_path="$newlib_search_path $absdir"
  1861. # Link against this library
  1862. test "$link_static" = no && newdependency_libs="$abs_ladir/$laname $newdependency_libs"
  1863. # ... and its dependency_libs
  1864. tmp_libs=
  1865. for deplib in $dependency_libs; do
  1866. newdependency_libs="$deplib $newdependency_libs"
  1867. if test "X$duplicate_deps" = "Xyes" ; then
  1868. case "$tmp_libs " in
  1869. *" $deplib "*) specialdeplibs="$specialdeplibs $deplib" ;;
  1870. esac
  1871. fi
  1872. tmp_libs="$tmp_libs $deplib"
  1873. done
  1874. if test $link_all_deplibs != no; then
  1875. # Add the search paths of all dependency libraries
  1876. for deplib in $dependency_libs; do
  1877. case $deplib in
  1878. -L*) path="$deplib" ;;
  1879. *.la)
  1880. dir=`$echo "X$deplib" | $Xsed -e 's%/[^/]*$%%'`
  1881. test "X$dir" = "X$deplib" && dir="."
  1882. # We need an absolute path.
  1883. case $dir in
  1884. [\\/]* | [A-Za-z]:[\\/]*) absdir="$dir" ;;
  1885. *)
  1886. absdir=`cd "$dir" && pwd`
  1887. if test -z "$absdir"; then
  1888. $echo "$modename: warning: cannot determine absolute directory name of \`$dir'" 1>&2
  1889. absdir="$dir"
  1890. fi
  1891. ;;
  1892. esac
  1893. if grep "^installed=no" $deplib > /dev/null; then
  1894. path="-L$absdir/$objdir"
  1895. else
  1896. eval libdir=`${SED} -n -e 's/^libdir=\(.*\)$/\1/p' $deplib`
  1897. if test -z "$libdir"; then
  1898. $echo "$modename: \`$deplib' is not a valid libtool archive" 1>&2
  1899. exit 1
  1900. fi
  1901. if test "$absdir" != "$libdir"; then
  1902. $echo "$modename: warning: \`$deplib' seems to be moved" 1>&2
  1903. fi
  1904. path="-L$absdir"
  1905. fi
  1906. ;;
  1907. *) continue ;;
  1908. esac
  1909. case " $deplibs " in
  1910. *" $path "*) ;;
  1911. *) deplibs="$deplibs $path" ;;
  1912. esac
  1913. done
  1914. fi # link_all_deplibs != no
  1915. fi # linkmode = lib
  1916. done # for deplib in $libs
  1917. if test $pass = dlpreopen; then
  1918. # Link the dlpreopened libraries before other libraries
  1919. for deplib in $save_deplibs; do
  1920. deplibs="$deplib $deplibs"
  1921. done
  1922. fi
  1923. if test $pass != dlopen; then
  1924. test $pass != scan && dependency_libs="$newdependency_libs"
  1925. if test $pass != conv; then
  1926. # Make sure lib_search_path contains only unique directories.
  1927. lib_search_path=
  1928. for dir in $newlib_search_path; do
  1929. case "$lib_search_path " in
  1930. *" $dir "*) ;;
  1931. *) lib_search_path="$lib_search_path $dir" ;;
  1932. esac
  1933. done
  1934. newlib_search_path=
  1935. fi
  1936. if test "$linkmode,$pass" != "prog,link"; then
  1937. vars="deplibs"
  1938. else
  1939. vars="compile_deplibs finalize_deplibs"
  1940. fi
  1941. for var in $vars dependency_libs; do
  1942. # Add libraries to $var in reverse order
  1943. eval tmp_libs=\"\$$var\"
  1944. new_libs=
  1945. for deplib in $tmp_libs; do
  1946. case $deplib in
  1947. -L*) new_libs="$deplib $new_libs" ;;
  1948. *)
  1949. case " $specialdeplibs " in
  1950. *" $deplib "*) new_libs="$deplib $new_libs" ;;
  1951. *)
  1952. case " $new_libs " in
  1953. *" $deplib "*) ;;
  1954. *) new_libs="$deplib $new_libs" ;;
  1955. esac
  1956. ;;
  1957. esac
  1958. ;;
  1959. esac
  1960. done
  1961. tmp_libs=
  1962. for deplib in $new_libs; do
  1963. case $deplib in
  1964. -L*)
  1965. case " $tmp_libs " in
  1966. *" $deplib "*) ;;
  1967. *) tmp_libs="$tmp_libs $deplib" ;;
  1968. esac
  1969. ;;
  1970. *) tmp_libs="$tmp_libs $deplib" ;;
  1971. esac
  1972. done
  1973. eval $var=\"$tmp_libs\"
  1974. done # for var
  1975. fi
  1976. if test "$pass" = "conv" &&
  1977. { test "$linkmode" = "lib" || test "$linkmode" = "prog"; }; then
  1978. libs="$deplibs" # reset libs
  1979. deplibs=
  1980. fi
  1981. done # for pass
  1982. if test $linkmode = prog; then
  1983. dlfiles="$newdlfiles"
  1984. dlprefiles="$newdlprefiles"
  1985. fi
  1986. case $linkmode in
  1987. oldlib)
  1988. if test -n "$dlfiles$dlprefiles" || test "$dlself" != no; then
  1989. $echo "$modename: warning: \`-dlopen' is ignored for archives" 1>&2
  1990. fi
  1991. if test -n "$rpath"; then
  1992. $echo "$modename: warning: \`-rpath' is ignored for archives" 1>&2
  1993. fi
  1994. if test -n "$xrpath"; then
  1995. $echo "$modename: warning: \`-R' is ignored for archives" 1>&2
  1996. fi
  1997. if test -n "$vinfo"; then
  1998. $echo "$modename: warning: \`-version-info' is ignored for archives" 1>&2
  1999. fi
  2000. if test -n "$release"; then
  2001. $echo "$modename: warning: \`-release' is ignored for archives" 1>&2
  2002. fi
  2003. if test -n "$export_symbols" || test -n "$export_symbols_regex"; then
  2004. $echo "$modename: warning: \`-export-symbols' is ignored for archives" 1>&2
  2005. fi
  2006. # Now set the variables for building old libraries.
  2007. build_libtool_libs=no
  2008. oldlibs="$output"
  2009. objs="$objs$old_deplibs"
  2010. ;;
  2011. lib)
  2012. # Make sure we only generate libraries of the form `libNAME.la'.
  2013. case $outputname in
  2014. lib*)
  2015. name=`$echo "X$outputname" | $Xsed -e 's/\.la$//' -e 's/^lib//'`
  2016. eval libname=\"$libname_spec\"
  2017. ;;
  2018. *)
  2019. if test "$module" = no; then
  2020. $echo "$modename: libtool library \`$output' must begin with \`lib'" 1>&2
  2021. $echo "$help" 1>&2
  2022. exit 1
  2023. fi
  2024. if test "$need_lib_prefix" != no; then
  2025. # Add the "lib" prefix for modules if required
  2026. name=`$echo "X$outputname" | $Xsed -e 's/\.la$//'`
  2027. eval libname=\"$libname_spec\"
  2028. else
  2029. libname=`$echo "X$outputname" | $Xsed -e 's/\.la$//'`
  2030. fi
  2031. ;;
  2032. esac
  2033. if test -n "$objs"; then
  2034. if test "$deplibs_check_method" != pass_all; then
  2035. $echo "$modename: cannot build libtool library \`$output' from non-libtool objects on this host:$objs" 2>&1
  2036. exit 1
  2037. else
  2038. echo
  2039. echo "*** Warning: Linking the shared library $output against the non-libtool"
  2040. echo "*** objects $objs is not portable!"
  2041. libobjs="$libobjs $objs"
  2042. fi
  2043. fi
  2044. if test "$dlself" != no; then
  2045. $echo "$modename: warning: \`-dlopen self' is ignored for libtool libraries" 1>&2
  2046. fi
  2047. set dummy $rpath
  2048. if test $# -gt 2; then
  2049. $echo "$modename: warning: ignoring multiple \`-rpath's for a libtool library" 1>&2
  2050. fi
  2051. install_libdir="$2"
  2052. oldlibs=
  2053. if test -z "$rpath"; then
  2054. if test "$build_libtool_libs" = yes; then
  2055. # Building a libtool convenience library.
  2056. libext=al
  2057. oldlibs="$output_objdir/$libname.$libext $oldlibs"
  2058. build_libtool_libs=convenience
  2059. build_old_libs=yes
  2060. fi
  2061. if test -n "$vinfo"; then
  2062. $echo "$modename: warning: \`-version-info' is ignored for convenience libraries" 1>&2
  2063. fi
  2064. if test -n "$release"; then
  2065. $echo "$modename: warning: \`-release' is ignored for convenience libraries" 1>&2
  2066. fi
  2067. else
  2068. # Parse the version information argument.
  2069. save_ifs="$IFS"; IFS=':'
  2070. set dummy $vinfo 0 0 0
  2071. IFS="$save_ifs"
  2072. if test -n "$8"; then
  2073. $echo "$modename: too many parameters to \`-version-info'" 1>&2
  2074. $echo "$help" 1>&2
  2075. exit 1
  2076. fi
  2077. current="$2"
  2078. revision="$3"
  2079. age="$4"
  2080. # Check that each of the things are valid numbers.
  2081. case $current in
  2082. [0-9]*) ;;
  2083. *)
  2084. $echo "$modename: CURRENT \`$current' is not a nonnegative integer" 1>&2
  2085. $echo "$modename: \`$vinfo' is not valid version information" 1>&2
  2086. exit 1
  2087. ;;
  2088. esac
  2089. case $revision in
  2090. [0-9]*) ;;
  2091. *)
  2092. $echo "$modename: REVISION \`$revision' is not a nonnegative integer" 1>&2
  2093. $echo "$modename: \`$vinfo' is not valid version information" 1>&2
  2094. exit 1
  2095. ;;
  2096. esac
  2097. case $age in
  2098. [0-9]*) ;;
  2099. *)
  2100. $echo "$modename: AGE \`$age' is not a nonnegative integer" 1>&2
  2101. $echo "$modename: \`$vinfo' is not valid version information" 1>&2
  2102. exit 1
  2103. ;;
  2104. esac
  2105. if test $age -gt $current; then
  2106. $echo "$modename: AGE \`$age' is greater than the current interface number \`$current'" 1>&2
  2107. $echo "$modename: \`$vinfo' is not valid version information" 1>&2
  2108. exit 1
  2109. fi
  2110. # Calculate the version variables.
  2111. major=
  2112. versuffix=
  2113. verstring=
  2114. case $version_type in
  2115. none) ;;
  2116. darwin)
  2117. # Like Linux, but with the current version available in
  2118. # verstring for coding it into the library header
  2119. major=.`expr $current - $age`
  2120. versuffix="$major.$age.$revision"
  2121. # Darwin ld doesn't like 0 for these options...
  2122. minor_current=`expr $current + 1`
  2123. verstring="-compatibility_version $minor_current -current_version $minor_current.$revision"
  2124. ;;
  2125. freebsd-aout)
  2126. major=".$current"
  2127. versuffix=".$current.$revision";
  2128. ;;
  2129. freebsd-elf)
  2130. major=".$current"
  2131. versuffix=".$current";
  2132. ;;
  2133. irix | nonstopux)
  2134. major=`expr $current - $age + 1`
  2135. case $version_type in
  2136. nonstopux) verstring_prefix=nonstopux ;;
  2137. *) verstring_prefix=sgi ;;
  2138. esac
  2139. verstring="$verstring_prefix$major.$revision"
  2140. # Add in all the interfaces that we are compatible with.
  2141. loop=$revision
  2142. while test $loop != 0; do
  2143. iface=`expr $revision - $loop`
  2144. loop=`expr $loop - 1`
  2145. verstring="$verstring_prefix$major.$iface:$verstring"
  2146. done
  2147. # Before this point, $major must not contain `.'.
  2148. major=.$major
  2149. versuffix="$major.$revision"
  2150. ;;
  2151. linux)
  2152. major=.`expr $current - $age`
  2153. versuffix="$major.$age.$revision"
  2154. ;;
  2155. osf)
  2156. major=.`expr $current - $age`
  2157. versuffix=".$current.$age.$revision"
  2158. verstring="$current.$age.$revision"
  2159. # Add in all the interfaces that we are compatible with.
  2160. loop=$age
  2161. while test $loop != 0; do
  2162. iface=`expr $current - $loop`
  2163. loop=`expr $loop - 1`
  2164. verstring="$verstring:${iface}.0"
  2165. done
  2166. # Make executables depend on our current version.
  2167. verstring="$verstring:${current}.0"
  2168. ;;
  2169. sunos)
  2170. major=".$current"
  2171. versuffix=".$current.$revision"
  2172. ;;
  2173. windows)
  2174. # Use '-' rather than '.', since we only want one
  2175. # extension on DOS 8.3 filesystems.
  2176. major=`expr $current - $age`
  2177. versuffix="-$major"
  2178. ;;
  2179. *)
  2180. $echo "$modename: unknown library version type \`$version_type'" 1>&2
  2181. echo "Fatal configuration error. See the $PACKAGE docs for more information." 1>&2
  2182. exit 1
  2183. ;;
  2184. esac
  2185. # Clear the version info if we defaulted, and they specified a release.
  2186. if test -z "$vinfo" && test -n "$release"; then
  2187. major=
  2188. verstring="0.0"
  2189. case $version_type in
  2190. darwin)
  2191. # we can't check for "0.0" in archive_cmds due to quoting
  2192. # problems, so we reset it completely
  2193. verstring=""
  2194. ;;
  2195. *)
  2196. verstring="0.0"
  2197. ;;
  2198. esac
  2199. if test "$need_version" = no; then
  2200. versuffix=
  2201. else
  2202. versuffix=".0.0"
  2203. fi
  2204. fi
  2205. # Remove version info from name if versioning should be avoided
  2206. if test "$avoid_version" = yes && test "$need_version" = no; then
  2207. major=
  2208. versuffix=
  2209. verstring=""
  2210. fi
  2211. # Check to see if the archive will have undefined symbols.
  2212. if test "$allow_undefined" = yes; then
  2213. if test "$allow_undefined_flag" = unsupported; then
  2214. $echo "$modename: warning: undefined symbols not allowed in $host shared libraries" 1>&2
  2215. build_libtool_libs=no
  2216. build_old_libs=yes
  2217. fi
  2218. else
  2219. # Don't allow undefined symbols.
  2220. allow_undefined_flag="$no_undefined_flag"
  2221. fi
  2222. fi
  2223. if test "$mode" != relink; then
  2224. # Remove our outputs.
  2225. $show "${rm}r $output_objdir/$outputname $output_objdir/$libname.* $output_objdir/${libname}${release}.*"
  2226. $run ${rm}r $output_objdir/$outputname $output_objdir/$libname.* $output_objdir/${libname}${release}.*
  2227. fi
  2228. # Now set the variables for building old libraries.
  2229. if test "$build_old_libs" = yes && test "$build_libtool_libs" != convenience ; then
  2230. oldlibs="$oldlibs $output_objdir/$libname.$libext"
  2231. # Transform .lo files to .o files.
  2232. oldobjs="$objs "`$echo "X$libobjs" | $SP2NL | $Xsed -e '/\.'${libext}'$/d' -e "$lo2o" | $NL2SP`
  2233. fi
  2234. # Eliminate all temporary directories.
  2235. for path in $notinst_path; do
  2236. lib_search_path=`echo "$lib_search_path " | ${SED} -e 's% $path % %g'`
  2237. deplibs=`echo "$deplibs " | ${SED} -e 's% -L$path % %g'`
  2238. dependency_libs=`echo "$dependency_libs " | ${SED} -e 's% -L$path % %g'`
  2239. done
  2240. if test -n "$xrpath"; then
  2241. # If the user specified any rpath flags, then add them.
  2242. temp_xrpath=
  2243. for libdir in $xrpath; do
  2244. temp_xrpath="$temp_xrpath -R$libdir"
  2245. case "$finalize_rpath " in
  2246. *" $libdir "*) ;;
  2247. *) finalize_rpath="$finalize_rpath $libdir" ;;
  2248. esac
  2249. done
  2250. if test $hardcode_into_libs != yes || test $build_old_libs = yes; then
  2251. dependency_libs="$temp_xrpath $dependency_libs"
  2252. fi
  2253. fi
  2254. # Make sure dlfiles contains only unique files that won't be dlpreopened
  2255. old_dlfiles="$dlfiles"
  2256. dlfiles=
  2257. for lib in $old_dlfiles; do
  2258. case " $dlprefiles $dlfiles " in
  2259. *" $lib "*) ;;
  2260. *) dlfiles="$dlfiles $lib" ;;
  2261. esac
  2262. done
  2263. # Make sure dlprefiles contains only unique files
  2264. old_dlprefiles="$dlprefiles"
  2265. dlprefiles=
  2266. for lib in $old_dlprefiles; do
  2267. case "$dlprefiles " in
  2268. *" $lib "*) ;;
  2269. *) dlprefiles="$dlprefiles $lib" ;;
  2270. esac
  2271. done
  2272. if test "$build_libtool_libs" = yes; then
  2273. if test -n "$rpath"; then
  2274. case $host in
  2275. *-*-cygwin* | *-*-mingw* | *-*-pw32* | *-*-os2* | *-*-beos*)
  2276. # these systems don't actually have a c library (as such)!
  2277. ;;
  2278. *-*-rhapsody* | *-*-darwin1.[012])
  2279. # Rhapsody C library is in the System framework
  2280. deplibs="$deplibs -framework System"
  2281. ;;
  2282. *-*-netbsd*)
  2283. # Don't link with libc until the a.out ld.so is fixed.
  2284. ;;
  2285. *-*-openbsd* | *-*-freebsd*)
  2286. # Do not include libc due to us having libc/libc_r.
  2287. ;;
  2288. *)
  2289. # Add libc to deplibs on all other systems if necessary.
  2290. if test $build_libtool_need_lc = "yes"; then
  2291. deplibs="$deplibs -lc"
  2292. fi
  2293. ;;
  2294. esac
  2295. fi
  2296. # Transform deplibs into only deplibs that can be linked in shared.
  2297. name_save=$name
  2298. libname_save=$libname
  2299. release_save=$release
  2300. versuffix_save=$versuffix
  2301. major_save=$major
  2302. # I'm not sure if I'm treating the release correctly. I think
  2303. # release should show up in the -l (ie -lgmp5) so we don't want to
  2304. # add it in twice. Is that correct?
  2305. release=""
  2306. versuffix=""
  2307. major=""
  2308. newdeplibs=
  2309. droppeddeps=no
  2310. case $deplibs_check_method in
  2311. pass_all)
  2312. # Don't check for shared/static. Everything works.
  2313. # This might be a little naive. We might want to check
  2314. # whether the library exists or not. But this is on
  2315. # osf3 & osf4 and I'm not really sure... Just
  2316. # implementing what was already the behaviour.
  2317. newdeplibs=$deplibs
  2318. ;;
  2319. test_compile)
  2320. # This code stresses the "libraries are programs" paradigm to its
  2321. # limits. Maybe even breaks it. We compile a program, linking it
  2322. # against the deplibs as a proxy for the library. Then we can check
  2323. # whether they linked in statically or dynamically with ldd.
  2324. $rm conftest.c
  2325. cat > conftest.c <<EOF
  2326. int main() { return 0; }
  2327. EOF
  2328. $rm conftest
  2329. $CC -o conftest conftest.c $deplibs
  2330. if test $? -eq 0 ; then
  2331. ldd_output=`ldd conftest`
  2332. for i in $deplibs; do
  2333. name="`expr $i : '-l\(.*\)'`"
  2334. # If $name is empty we are operating on a -L argument.
  2335. if test -n "$name" && test "$name" != "0"; then
  2336. libname=`eval \\$echo \"$libname_spec\"`
  2337. deplib_matches=`eval \\$echo \"$library_names_spec\"`
  2338. set dummy $deplib_matches
  2339. deplib_match=$2
  2340. if test `expr "$ldd_output" : ".*$deplib_match"` -ne 0 ; then
  2341. newdeplibs="$newdeplibs $i"
  2342. else
  2343. droppeddeps=yes
  2344. echo
  2345. echo "*** Warning: dynamic linker does not accept needed library $i."
  2346. echo "*** I have the capability to make that library automatically link in when"
  2347. echo "*** you link to this library. But I can only do this if you have a"
  2348. echo "*** shared version of the library, which I believe you do not have"
  2349. echo "*** because a test_compile did reveal that the linker did not use it for"
  2350. echo "*** its dynamic dependency list that programs get resolved with at runtime."
  2351. fi
  2352. else
  2353. newdeplibs="$newdeplibs $i"
  2354. fi
  2355. done
  2356. else
  2357. # Error occured in the first compile. Let's try to salvage
  2358. # the situation: Compile a separate program for each library.
  2359. for i in $deplibs; do
  2360. name="`expr $i : '-l\(.*\)'`"
  2361. # If $name is empty we are operating on a -L argument.
  2362. if test -n "$name" && test "$name" != "0"; then
  2363. $rm conftest
  2364. $CC -o conftest conftest.c $i
  2365. # Did it work?
  2366. if test $? -eq 0 ; then
  2367. ldd_output=`ldd conftest`
  2368. libname=`eval \\$echo \"$libname_spec\"`
  2369. deplib_matches=`eval \\$echo \"$library_names_spec\"`
  2370. set dummy $deplib_matches
  2371. deplib_match=$2
  2372. if test `expr "$ldd_output" : ".*$deplib_match"` -ne 0 ; then
  2373. newdeplibs="$newdeplibs $i"
  2374. else
  2375. droppeddeps=yes
  2376. echo
  2377. echo "*** Warning: dynamic linker does not accept needed library $i."
  2378. echo "*** I have the capability to make that library automatically link in when"
  2379. echo "*** you link to this library. But I can only do this if you have a"
  2380. echo "*** shared version of the library, which you do not appear to have"
  2381. echo "*** because a test_compile did reveal that the linker did not use this one"
  2382. echo "*** as a dynamic dependency that programs can get resolved with at runtime."
  2383. fi
  2384. else
  2385. droppeddeps=yes
  2386. echo
  2387. echo "*** Warning! Library $i is needed by this library but I was not able to"
  2388. echo "*** make it link in! You will probably need to install it or some"
  2389. echo "*** library that it depends on before this library will be fully"
  2390. echo "*** functional. Installing it before continuing would be even better."
  2391. fi
  2392. else
  2393. newdeplibs="$newdeplibs $i"
  2394. fi
  2395. done
  2396. fi
  2397. ;;
  2398. file_magic*)
  2399. set dummy $deplibs_check_method
  2400. file_magic_regex=`expr "$deplibs_check_method" : "$2 \(.*\)"`
  2401. for a_deplib in $deplibs; do
  2402. name="`expr $a_deplib : '-l\(.*\)'`"
  2403. # If $name is empty we are operating on a -L argument.
  2404. if test -n "$name" && test "$name" != "0"; then
  2405. libname=`eval \\$echo \"$libname_spec\"`
  2406. for i in $lib_search_path $sys_lib_search_path $shlib_search_path; do
  2407. potential_libs=`ls $i/$libname[.-]* 2>/dev/null`
  2408. for potent_lib in $potential_libs; do
  2409. # Follow soft links.
  2410. if ls -lLd "$potent_lib" 2>/dev/null \
  2411. | grep " -> " >/dev/null; then
  2412. continue
  2413. fi
  2414. # The statement above tries to avoid entering an
  2415. # endless loop below, in case of cyclic links.
  2416. # We might still enter an endless loop, since a link
  2417. # loop can be closed while we follow links,
  2418. # but so what?
  2419. potlib="$potent_lib"
  2420. while test -h "$potlib" 2>/dev/null; do
  2421. potliblink=`ls -ld $potlib | ${SED} 's/.* -> //'`
  2422. case $potliblink in
  2423. [\\/]* | [A-Za-z]:[\\/]*) potlib="$potliblink";;
  2424. *) potlib=`$echo "X$potlib" | $Xsed -e 's,[^/]*$,,'`"$potliblink";;
  2425. esac
  2426. done
  2427. # It is ok to link against an archive when
  2428. # building a shared library.
  2429. if $AR -t $potlib > /dev/null 2>&1; then
  2430. newdeplibs="$newdeplibs $a_deplib"
  2431. a_deplib=""
  2432. break 2
  2433. fi
  2434. if eval $file_magic_cmd \"\$potlib\" 2>/dev/null \
  2435. | ${SED} 10q \
  2436. | egrep "$file_magic_regex" > /dev/null; then
  2437. newdeplibs="$newdeplibs $a_deplib"
  2438. a_deplib=""
  2439. break 2
  2440. fi
  2441. done
  2442. done
  2443. if test -n "$a_deplib" ; then
  2444. droppeddeps=yes
  2445. echo
  2446. echo "*** Warning: linker path does not have real file for library $a_deplib."
  2447. echo "*** I have the capability to make that library automatically link in when"
  2448. echo "*** you link to this library. But I can only do this if you have a"
  2449. echo "*** shared version of the library, which you do not appear to have"
  2450. echo "*** because I did check the linker path looking for a file starting"
  2451. if test -z "$potlib" ; then
  2452. echo "*** with $libname but no candidates were found. (...for file magic test)"
  2453. else
  2454. echo "*** with $libname and none of the candidates passed a file format test"
  2455. echo "*** using a file magic. Last file checked: $potlib"
  2456. fi
  2457. fi
  2458. else
  2459. # Add a -L argument.
  2460. newdeplibs="$newdeplibs $a_deplib"
  2461. fi
  2462. done # Gone through all deplibs.
  2463. ;;
  2464. match_pattern*)
  2465. set dummy $deplibs_check_method
  2466. match_pattern_regex=`expr "$deplibs_check_method" : "$2 \(.*\)"`
  2467. for a_deplib in $deplibs; do
  2468. name="`expr $a_deplib : '-l\(.*\)'`"
  2469. # If $name is empty we are operating on a -L argument.
  2470. if test -n "$name" && test "$name" != "0"; then
  2471. libname=`eval \\$echo \"$libname_spec\"`
  2472. for i in $lib_search_path $sys_lib_search_path $shlib_search_path; do
  2473. potential_libs=`ls $i/$libname[.-]* 2>/dev/null`
  2474. for potent_lib in $potential_libs; do
  2475. potlib="$potent_lib" # see symlink-check below in file_magic test
  2476. if eval echo \"$potent_lib\" 2>/dev/null \
  2477. | ${SED} 10q \
  2478. | egrep "$match_pattern_regex" > /dev/null; then
  2479. newdeplibs="$newdeplibs $a_deplib"
  2480. a_deplib=""
  2481. break 2
  2482. fi
  2483. done
  2484. done
  2485. if test -n "$a_deplib" ; then
  2486. droppeddeps=yes
  2487. echo
  2488. echo "*** Warning: linker path does not have real file for library $a_deplib."
  2489. echo "*** I have the capability to make that library automatically link in when"
  2490. echo "*** you link to this library. But I can only do this if you have a"
  2491. echo "*** shared version of the library, which you do not appear to have"
  2492. echo "*** because I did check the linker path looking for a file starting"
  2493. if test -z "$potlib" ; then
  2494. echo "*** with $libname but no candidates were found. (...for regex pattern test)"
  2495. else
  2496. echo "*** with $libname and none of the candidates passed a file format test"
  2497. echo "*** using a regex pattern. Last file checked: $potlib"
  2498. fi
  2499. fi
  2500. else
  2501. # Add a -L argument.
  2502. newdeplibs="$newdeplibs $a_deplib"
  2503. fi
  2504. done # Gone through all deplibs.
  2505. ;;
  2506. none | unknown | *)
  2507. newdeplibs=""
  2508. if $echo "X $deplibs" | $Xsed -e 's/ -lc$//' \
  2509. -e 's/ -[LR][^ ]*//g' -e 's/[ ]//g' |
  2510. grep . >/dev/null; then
  2511. echo
  2512. if test "X$deplibs_check_method" = "Xnone"; then
  2513. echo "*** Warning: inter-library dependencies are not supported in this platform."
  2514. else
  2515. echo "*** Warning: inter-library dependencies are not known to be supported."
  2516. fi
  2517. echo "*** All declared inter-library dependencies are being dropped."
  2518. droppeddeps=yes
  2519. fi
  2520. ;;
  2521. esac
  2522. versuffix=$versuffix_save
  2523. major=$major_save
  2524. release=$release_save
  2525. libname=$libname_save
  2526. name=$name_save
  2527. case $host in
  2528. *-*-rhapsody* | *-*-darwin1.[012])
  2529. # On Rhapsody replace the C library is the System framework
  2530. newdeplibs=`$echo "X $newdeplibs" | $Xsed -e 's/ -lc / -framework System /'`
  2531. ;;
  2532. esac
  2533. if test "$droppeddeps" = yes; then
  2534. if test "$module" = yes; then
  2535. echo
  2536. echo "*** Warning: libtool could not satisfy all declared inter-library"
  2537. echo "*** dependencies of module $libname. Therefore, libtool will create"
  2538. echo "*** a static module, that should work as long as the dlopening"
  2539. echo "*** application is linked with the -dlopen flag."
  2540. if test -z "$global_symbol_pipe"; then
  2541. echo
  2542. echo "*** However, this would only work if libtool was able to extract symbol"
  2543. echo "*** lists from a program, using \`nm' or equivalent, but libtool could"
  2544. echo "*** not find such a program. So, this module is probably useless."
  2545. echo "*** \`nm' from GNU binutils and a full rebuild may help."
  2546. fi
  2547. if test "$build_old_libs" = no; then
  2548. oldlibs="$output_objdir/$libname.$libext"
  2549. build_libtool_libs=module
  2550. build_old_libs=yes
  2551. else
  2552. build_libtool_libs=no
  2553. fi
  2554. else
  2555. echo "*** The inter-library dependencies that have been dropped here will be"
  2556. echo "*** automatically added whenever a program is linked with this library"
  2557. echo "*** or is declared to -dlopen it."
  2558. if test $allow_undefined = no; then
  2559. echo
  2560. echo "*** Since this library must not contain undefined symbols,"
  2561. echo "*** because either the platform does not support them or"
  2562. echo "*** it was explicitly requested with -no-undefined,"
  2563. echo "*** libtool will only create a static version of it."
  2564. if test "$build_old_libs" = no; then
  2565. oldlibs="$output_objdir/$libname.$libext"
  2566. build_libtool_libs=module
  2567. build_old_libs=yes
  2568. else
  2569. build_libtool_libs=no
  2570. fi
  2571. fi
  2572. fi
  2573. fi
  2574. # Done checking deplibs!
  2575. deplibs=$newdeplibs
  2576. fi
  2577. # All the library-specific variables (install_libdir is set above).
  2578. library_names=
  2579. old_library=
  2580. dlname=
  2581. # Test again, we may have decided not to build it any more
  2582. if test "$build_libtool_libs" = yes; then
  2583. if test $hardcode_into_libs = yes; then
  2584. # Hardcode the library paths
  2585. hardcode_libdirs=
  2586. dep_rpath=
  2587. rpath="$finalize_rpath"
  2588. test "$mode" != relink && rpath="$compile_rpath$rpath"
  2589. for libdir in $rpath; do
  2590. if test -n "$hardcode_libdir_flag_spec"; then
  2591. if test -n "$hardcode_libdir_separator"; then
  2592. if test -z "$hardcode_libdirs"; then
  2593. hardcode_libdirs="$libdir"
  2594. else
  2595. # Just accumulate the unique libdirs.
  2596. case $hardcode_libdir_separator$hardcode_libdirs$hardcode_libdir_separator in
  2597. *"$hardcode_libdir_separator$libdir$hardcode_libdir_separator"*)
  2598. ;;
  2599. *)
  2600. hardcode_libdirs="$hardcode_libdirs$hardcode_libdir_separator$libdir"
  2601. ;;
  2602. esac
  2603. fi
  2604. else
  2605. eval flag=\"$hardcode_libdir_flag_spec\"
  2606. dep_rpath="$dep_rpath $flag"
  2607. fi
  2608. elif test -n "$runpath_var"; then
  2609. case "$perm_rpath " in
  2610. *" $libdir "*) ;;
  2611. *) perm_rpath="$perm_rpath $libdir" ;;
  2612. esac
  2613. fi
  2614. done
  2615. # Substitute the hardcoded libdirs into the rpath.
  2616. if test -n "$hardcode_libdir_separator" &&
  2617. test -n "$hardcode_libdirs"; then
  2618. libdir="$hardcode_libdirs"
  2619. eval dep_rpath=\"$hardcode_libdir_flag_spec\"
  2620. fi
  2621. if test -n "$runpath_var" && test -n "$perm_rpath"; then
  2622. # We should set the runpath_var.
  2623. rpath=
  2624. for dir in $perm_rpath; do
  2625. rpath="$rpath$dir:"
  2626. done
  2627. eval "$runpath_var='$rpath\$$runpath_var'; export $runpath_var"
  2628. fi
  2629. test -n "$dep_rpath" && deplibs="$dep_rpath $deplibs"
  2630. fi
  2631. shlibpath="$finalize_shlibpath"
  2632. test "$mode" != relink && shlibpath="$compile_shlibpath$shlibpath"
  2633. if test -n "$shlibpath"; then
  2634. eval "$shlibpath_var='$shlibpath\$$shlibpath_var'; export $shlibpath_var"
  2635. fi
  2636. # Get the real and link names of the library.
  2637. eval library_names=\"$library_names_spec\"
  2638. set dummy $library_names
  2639. realname="$2"
  2640. shift; shift
  2641. if test -n "$soname_spec"; then
  2642. eval soname=\"$soname_spec\"
  2643. else
  2644. soname="$realname"
  2645. fi
  2646. test -z "$dlname" && dlname=$soname
  2647. lib="$output_objdir/$realname"
  2648. for link
  2649. do
  2650. linknames="$linknames $link"
  2651. done
  2652. # Ensure that we have .o objects for linkers which dislike .lo
  2653. # (e.g. aix) in case we are running --disable-static
  2654. for obj in $libobjs; do
  2655. xdir=`$echo "X$obj" | $Xsed -e 's%/[^/]*$%%'`
  2656. if test "X$xdir" = "X$obj"; then
  2657. xdir="."
  2658. else
  2659. xdir="$xdir"
  2660. fi
  2661. baseobj=`$echo "X$obj" | $Xsed -e 's%^.*/%%'`
  2662. oldobj=`$echo "X$baseobj" | $Xsed -e "$lo2o"`
  2663. if test ! -f $xdir/$oldobj; then
  2664. $show "(cd $xdir && ${LN_S} $baseobj $oldobj)"
  2665. $run eval '(cd $xdir && ${LN_S} $baseobj $oldobj)' || exit $?
  2666. fi
  2667. done
  2668. # Use standard objects if they are pic
  2669. test -z "$pic_flag" && libobjs=`$echo "X$libobjs" | $SP2NL | $Xsed -e "$lo2o" | $NL2SP`
  2670. # Prepare the list of exported symbols
  2671. if test -z "$export_symbols"; then
  2672. if test "$always_export_symbols" = yes || test -n "$export_symbols_regex"; then
  2673. $show "generating symbol list for \`$libname.la'"
  2674. export_symbols="$output_objdir/$libname.exp"
  2675. $run $rm $export_symbols
  2676. eval cmds=\"$export_symbols_cmds\"
  2677. save_ifs="$IFS"; IFS='~'
  2678. for cmd in $cmds; do
  2679. IFS="$save_ifs"
  2680. $show "$cmd"
  2681. $run eval "$cmd" || exit $?
  2682. done
  2683. IFS="$save_ifs"
  2684. if test -n "$export_symbols_regex"; then
  2685. $show "egrep -e \"$export_symbols_regex\" \"$export_symbols\" > \"${export_symbols}T\""
  2686. $run eval 'egrep -e "$export_symbols_regex" "$export_symbols" > "${export_symbols}T"'
  2687. $show "$mv \"${export_symbols}T\" \"$export_symbols\""
  2688. $run eval '$mv "${export_symbols}T" "$export_symbols"'
  2689. fi
  2690. fi
  2691. fi
  2692. if test -n "$export_symbols" && test -n "$include_expsyms"; then
  2693. $run eval '$echo "X$include_expsyms" | $SP2NL >> "$export_symbols"'
  2694. fi
  2695. if test -n "$convenience"; then
  2696. if test -n "$whole_archive_flag_spec"; then
  2697. eval libobjs=\"\$libobjs $whole_archive_flag_spec\"
  2698. else
  2699. gentop="$output_objdir/${outputname}x"
  2700. $show "${rm}r $gentop"
  2701. $run ${rm}r "$gentop"
  2702. $show "mkdir $gentop"
  2703. $run mkdir "$gentop"
  2704. status=$?
  2705. if test $status -ne 0 && test ! -d "$gentop"; then
  2706. exit $status
  2707. fi
  2708. generated="$generated $gentop"
  2709. for xlib in $convenience; do
  2710. # Extract the objects.
  2711. case $xlib in
  2712. [\\/]* | [A-Za-z]:[\\/]*) xabs="$xlib" ;;
  2713. *) xabs=`pwd`"/$xlib" ;;
  2714. esac
  2715. xlib=`$echo "X$xlib" | $Xsed -e 's%^.*/%%'`
  2716. xdir="$gentop/$xlib"
  2717. $show "${rm}r $xdir"
  2718. $run ${rm}r "$xdir"
  2719. $show "mkdir $xdir"
  2720. $run mkdir "$xdir"
  2721. status=$?
  2722. if test $status -ne 0 && test ! -d "$xdir"; then
  2723. exit $status
  2724. fi
  2725. $show "(cd $xdir && $AR x $xabs)"
  2726. $run eval "(cd \$xdir && $AR x \$xabs)" || exit $?
  2727. libobjs="$libobjs "`find $xdir -name \*.o -print -o -name \*.lo -print | $NL2SP`
  2728. done
  2729. fi
  2730. fi
  2731. if test "$thread_safe" = yes && test -n "$thread_safe_flag_spec"; then
  2732. eval flag=\"$thread_safe_flag_spec\"
  2733. linker_flags="$linker_flags $flag"
  2734. fi
  2735. # Make a backup of the uninstalled library when relinking
  2736. if test "$mode" = relink; then
  2737. $run eval '(cd $output_objdir && $rm ${realname}U && $mv $realname ${realname}U)' || exit $?
  2738. fi
  2739. # Do each of the archive commands.
  2740. if test -n "$export_symbols" && test -n "$archive_expsym_cmds"; then
  2741. eval cmds=\"$archive_expsym_cmds\"
  2742. else
  2743. save_deplibs="$deplibs"
  2744. for conv in $convenience; do
  2745. tmp_deplibs=
  2746. for test_deplib in $deplibs; do
  2747. if test "$test_deplib" != "$conv"; then
  2748. tmp_deplibs="$tmp_deplibs $test_deplib"
  2749. fi
  2750. done
  2751. deplibs="$tmp_deplibs"
  2752. done
  2753. eval cmds=\"$archive_cmds\"
  2754. deplibs="$save_deplibs"
  2755. fi
  2756. save_ifs="$IFS"; IFS='~'
  2757. for cmd in $cmds; do
  2758. IFS="$save_ifs"
  2759. $show "$cmd"
  2760. $run eval "$cmd" || exit $?
  2761. done
  2762. IFS="$save_ifs"
  2763. # Restore the uninstalled library and exit
  2764. if test "$mode" = relink; then
  2765. $run eval '(cd $output_objdir && $rm ${realname}T && $mv $realname ${realname}T && $mv "$realname"U $realname)' || exit $?
  2766. exit 0
  2767. fi
  2768. # Create links to the real library.
  2769. for linkname in $linknames; do
  2770. if test "$realname" != "$linkname"; then
  2771. $show "(cd $output_objdir && $rm $linkname && $LN_S $realname $linkname)"
  2772. $run eval '(cd $output_objdir && $rm $linkname && $LN_S $realname $linkname)' || exit $?
  2773. fi
  2774. done
  2775. # If -module or -export-dynamic was specified, set the dlname.
  2776. if test "$module" = yes || test "$export_dynamic" = yes; then
  2777. # On all known operating systems, these are identical.
  2778. dlname="$soname"
  2779. fi
  2780. fi
  2781. ;;
  2782. obj)
  2783. if test -n "$deplibs"; then
  2784. $echo "$modename: warning: \`-l' and \`-L' are ignored for objects" 1>&2
  2785. fi
  2786. if test -n "$dlfiles$dlprefiles" || test "$dlself" != no; then
  2787. $echo "$modename: warning: \`-dlopen' is ignored for objects" 1>&2
  2788. fi
  2789. if test -n "$rpath"; then
  2790. $echo "$modename: warning: \`-rpath' is ignored for objects" 1>&2
  2791. fi
  2792. if test -n "$xrpath"; then
  2793. $echo "$modename: warning: \`-R' is ignored for objects" 1>&2
  2794. fi
  2795. if test -n "$vinfo"; then
  2796. $echo "$modename: warning: \`-version-info' is ignored for objects" 1>&2
  2797. fi
  2798. if test -n "$release"; then
  2799. $echo "$modename: warning: \`-release' is ignored for objects" 1>&2
  2800. fi
  2801. case $output in
  2802. *.lo)
  2803. if test -n "$objs$old_deplibs"; then
  2804. $echo "$modename: cannot build library object \`$output' from non-libtool objects" 1>&2
  2805. exit 1
  2806. fi
  2807. libobj="$output"
  2808. obj=`$echo "X$output" | $Xsed -e "$lo2o"`
  2809. ;;
  2810. *)
  2811. libobj=
  2812. obj="$output"
  2813. ;;
  2814. esac
  2815. # Delete the old objects.
  2816. $run $rm $obj $libobj
  2817. # Objects from convenience libraries. This assumes
  2818. # single-version convenience libraries. Whenever we create
  2819. # different ones for PIC/non-PIC, this we'll have to duplicate
  2820. # the extraction.
  2821. reload_conv_objs=
  2822. gentop=
  2823. # reload_cmds runs $LD directly, so let us get rid of
  2824. # -Wl from whole_archive_flag_spec
  2825. wl=
  2826. if test -n "$convenience"; then
  2827. if test -n "$whole_archive_flag_spec"; then
  2828. eval reload_conv_objs=\"\$reload_objs $whole_archive_flag_spec\"
  2829. else
  2830. gentop="$output_objdir/${obj}x"
  2831. $show "${rm}r $gentop"
  2832. $run ${rm}r "$gentop"
  2833. $show "mkdir $gentop"
  2834. $run mkdir "$gentop"
  2835. status=$?
  2836. if test $status -ne 0 && test ! -d "$gentop"; then
  2837. exit $status
  2838. fi
  2839. generated="$generated $gentop"
  2840. for xlib in $convenience; do
  2841. # Extract the objects.
  2842. case $xlib in
  2843. [\\/]* | [A-Za-z]:[\\/]*) xabs="$xlib" ;;
  2844. *) xabs=`pwd`"/$xlib" ;;
  2845. esac
  2846. xlib=`$echo "X$xlib" | $Xsed -e 's%^.*/%%'`
  2847. xdir="$gentop/$xlib"
  2848. $show "${rm}r $xdir"
  2849. $run ${rm}r "$xdir"
  2850. $show "mkdir $xdir"
  2851. $run mkdir "$xdir"
  2852. status=$?
  2853. if test $status -ne 0 && test ! -d "$xdir"; then
  2854. exit $status
  2855. fi
  2856. $show "(cd $xdir && $AR x $xabs)"
  2857. $run eval "(cd \$xdir && $AR x \$xabs)" || exit $?
  2858. reload_conv_objs="$reload_objs "`find $xdir -name \*.o -print -o -name \*.lo -print | $NL2SP`
  2859. done
  2860. fi
  2861. fi
  2862. # Create the old-style object.
  2863. reload_objs="$objs$old_deplibs "`$echo "X$libobjs" | $SP2NL | $Xsed -e '/\.'${libext}$'/d' -e '/\.lib$/d' -e "$lo2o" | $NL2SP`" $reload_conv_objs" ### testsuite: skip nested quoting test
  2864. output="$obj"
  2865. eval cmds=\"$reload_cmds\"
  2866. save_ifs="$IFS"; IFS='~'
  2867. for cmd in $cmds; do
  2868. IFS="$save_ifs"
  2869. $show "$cmd"
  2870. $run eval "$cmd" || exit $?
  2871. done
  2872. IFS="$save_ifs"
  2873. # Exit if we aren't doing a library object file.
  2874. if test -z "$libobj"; then
  2875. if test -n "$gentop"; then
  2876. $show "${rm}r $gentop"
  2877. $run ${rm}r $gentop
  2878. fi
  2879. exit 0
  2880. fi
  2881. if test "$build_libtool_libs" != yes; then
  2882. if test -n "$gentop"; then
  2883. $show "${rm}r $gentop"
  2884. $run ${rm}r $gentop
  2885. fi
  2886. # Create an invalid libtool object if no PIC, so that we don't
  2887. # accidentally link it into a program.
  2888. $show "echo timestamp > $libobj"
  2889. $run eval "echo timestamp > $libobj" || exit $?
  2890. exit 0
  2891. fi
  2892. if test -n "$pic_flag" || test "$pic_mode" != default; then
  2893. # Only do commands if we really have different PIC objects.
  2894. reload_objs="$libobjs $reload_conv_objs"
  2895. output="$libobj"
  2896. eval cmds=\"$reload_cmds\"
  2897. save_ifs="$IFS"; IFS='~'
  2898. for cmd in $cmds; do
  2899. IFS="$save_ifs"
  2900. $show "$cmd"
  2901. $run eval "$cmd" || exit $?
  2902. done
  2903. IFS="$save_ifs"
  2904. else
  2905. # Just create a symlink.
  2906. $show $rm $libobj
  2907. $run $rm $libobj
  2908. xdir=`$echo "X$libobj" | $Xsed -e 's%/[^/]*$%%'`
  2909. if test "X$xdir" = "X$libobj"; then
  2910. xdir="."
  2911. else
  2912. xdir="$xdir"
  2913. fi
  2914. baseobj=`$echo "X$libobj" | $Xsed -e 's%^.*/%%'`
  2915. oldobj=`$echo "X$baseobj" | $Xsed -e "$lo2o"`
  2916. $show "(cd $xdir && $LN_S $oldobj $baseobj)"
  2917. $run eval '(cd $xdir && $LN_S $oldobj $baseobj)' || exit $?
  2918. fi
  2919. if test -n "$gentop"; then
  2920. $show "${rm}r $gentop"
  2921. $run ${rm}r $gentop
  2922. fi
  2923. exit 0
  2924. ;;
  2925. prog)
  2926. case $host in
  2927. *cygwin*) output=`echo $output | ${SED} -e 's,.exe$,,;s,$,.exe,'` ;;
  2928. esac
  2929. if test -n "$vinfo"; then
  2930. $echo "$modename: warning: \`-version-info' is ignored for programs" 1>&2
  2931. fi
  2932. if test -n "$release"; then
  2933. $echo "$modename: warning: \`-release' is ignored for programs" 1>&2
  2934. fi
  2935. if test "$preload" = yes; then
  2936. if test "$dlopen_support" = unknown && test "$dlopen_self" = unknown &&
  2937. test "$dlopen_self_static" = unknown; then
  2938. $echo "$modename: warning: \`AC_LIBTOOL_DLOPEN' not used. Assuming no dlopen support."
  2939. fi
  2940. fi
  2941. case $host in
  2942. *-*-rhapsody* | *-*-darwin1.[012])
  2943. # On Rhapsody replace the C library is the System framework
  2944. compile_deplibs=`$echo "X $compile_deplibs" | $Xsed -e 's/ -lc / -framework System /'`
  2945. finalize_deplibs=`$echo "X $finalize_deplibs" | $Xsed -e 's/ -lc / -framework System /'`
  2946. case $host in
  2947. *darwin*)
  2948. # Don't allow lazy linking, it breaks C++ global constructors
  2949. compile_command="$compile_command ${wl}-bind_at_load"
  2950. finalize_command="$finalize_command ${wl}-bind_at_load"
  2951. ;;
  2952. esac
  2953. ;;
  2954. esac
  2955. compile_command="$compile_command $compile_deplibs"
  2956. finalize_command="$finalize_command $finalize_deplibs"
  2957. if test -n "$rpath$xrpath"; then
  2958. # If the user specified any rpath flags, then add them.
  2959. for libdir in $rpath $xrpath; do
  2960. # This is the magic to use -rpath.
  2961. case "$finalize_rpath " in
  2962. *" $libdir "*) ;;
  2963. *) finalize_rpath="$finalize_rpath $libdir" ;;
  2964. esac
  2965. done
  2966. fi
  2967. # Now hardcode the library paths
  2968. rpath=
  2969. hardcode_libdirs=
  2970. for libdir in $compile_rpath $finalize_rpath; do
  2971. if test -n "$hardcode_libdir_flag_spec"; then
  2972. if test -n "$hardcode_libdir_separator"; then
  2973. if test -z "$hardcode_libdirs"; then
  2974. hardcode_libdirs="$libdir"
  2975. else
  2976. # Just accumulate the unique libdirs.
  2977. case $hardcode_libdir_separator$hardcode_libdirs$hardcode_libdir_separator in
  2978. *"$hardcode_libdir_separator$libdir$hardcode_libdir_separator"*)
  2979. ;;
  2980. *)
  2981. hardcode_libdirs="$hardcode_libdirs$hardcode_libdir_separator$libdir"
  2982. ;;
  2983. esac
  2984. fi
  2985. else
  2986. eval flag=\"$hardcode_libdir_flag_spec\"
  2987. rpath="$rpath $flag"
  2988. fi
  2989. elif test -n "$runpath_var"; then
  2990. case "$perm_rpath " in
  2991. *" $libdir "*) ;;
  2992. *) perm_rpath="$perm_rpath $libdir" ;;
  2993. esac
  2994. fi
  2995. case $host in
  2996. *-*-cygwin* | *-*-mingw* | *-*-pw32* | *-*-os2*)
  2997. case :$dllsearchpath: in
  2998. *":$libdir:"*) ;;
  2999. *) dllsearchpath="$dllsearchpath:$libdir";;
  3000. esac
  3001. ;;
  3002. esac
  3003. done
  3004. # Substitute the hardcoded libdirs into the rpath.
  3005. if test -n "$hardcode_libdir_separator" &&
  3006. test -n "$hardcode_libdirs"; then
  3007. libdir="$hardcode_libdirs"
  3008. eval rpath=\" $hardcode_libdir_flag_spec\"
  3009. fi
  3010. compile_rpath="$rpath"
  3011. rpath=
  3012. hardcode_libdirs=
  3013. for libdir in $finalize_rpath; do
  3014. if test -n "$hardcode_libdir_flag_spec"; then
  3015. if test -n "$hardcode_libdir_separator"; then
  3016. if test -z "$hardcode_libdirs"; then
  3017. hardcode_libdirs="$libdir"
  3018. else
  3019. # Just accumulate the unique libdirs.
  3020. case $hardcode_libdir_separator$hardcode_libdirs$hardcode_libdir_separator in
  3021. *"$hardcode_libdir_separator$libdir$hardcode_libdir_separator"*)
  3022. ;;
  3023. *)
  3024. hardcode_libdirs="$hardcode_libdirs$hardcode_libdir_separator$libdir"
  3025. ;;
  3026. esac
  3027. fi
  3028. else
  3029. eval flag=\"$hardcode_libdir_flag_spec\"
  3030. rpath="$rpath $flag"
  3031. fi
  3032. elif test -n "$runpath_var"; then
  3033. case "$finalize_perm_rpath " in
  3034. *" $libdir "*) ;;
  3035. *) finalize_perm_rpath="$finalize_perm_rpath $libdir" ;;
  3036. esac
  3037. fi
  3038. done
  3039. # Substitute the hardcoded libdirs into the rpath.
  3040. if test -n "$hardcode_libdir_separator" &&
  3041. test -n "$hardcode_libdirs"; then
  3042. libdir="$hardcode_libdirs"
  3043. eval rpath=\" $hardcode_libdir_flag_spec\"
  3044. fi
  3045. finalize_rpath="$rpath"
  3046. if test -n "$libobjs" && test "$build_old_libs" = yes; then
  3047. # Transform all the library objects into standard objects.
  3048. compile_command=`$echo "X$compile_command" | $SP2NL | $Xsed -e "$lo2o" | $NL2SP`
  3049. finalize_command=`$echo "X$finalize_command" | $SP2NL | $Xsed -e "$lo2o" | $NL2SP`
  3050. fi
  3051. dlsyms=
  3052. if test -n "$dlfiles$dlprefiles" || test "$dlself" != no; then
  3053. if test -n "$NM" && test -n "$global_symbol_pipe"; then
  3054. dlsyms="${outputname}S.c"
  3055. else
  3056. $echo "$modename: not configured to extract global symbols from dlpreopened files" 1>&2
  3057. fi
  3058. fi
  3059. if test -n "$dlsyms"; then
  3060. case $dlsyms in
  3061. "") ;;
  3062. *.c)
  3063. # Discover the nlist of each of the dlfiles.
  3064. nlist="$output_objdir/${outputname}.nm"
  3065. $show "$rm $nlist ${nlist}S ${nlist}T"
  3066. $run $rm "$nlist" "${nlist}S" "${nlist}T"
  3067. # Parse the name list into a source file.
  3068. $show "creating $output_objdir/$dlsyms"
  3069. test -z "$run" && $echo > "$output_objdir/$dlsyms" "\
  3070. /* $dlsyms - symbol resolution table for \`$outputname' dlsym emulation. */
  3071. /* Generated by $PROGRAM - GNU $PACKAGE $VERSION$TIMESTAMP */
  3072. #ifdef __cplusplus
  3073. extern \"C\" {
  3074. #endif
  3075. /* Prevent the only kind of declaration conflicts we can make. */
  3076. #define lt_preloaded_symbols some_other_symbol
  3077. /* External symbol declarations for the compiler. */\
  3078. "
  3079. if test "$dlself" = yes; then
  3080. $show "generating symbol list for \`$output'"
  3081. test -z "$run" && $echo ': @PROGRAM@ ' > "$nlist"
  3082. # Add our own program objects to the symbol list.
  3083. progfiles=`$echo "X$objs$old_deplibs" | $SP2NL | $Xsed -e "$lo2o" | $NL2SP`
  3084. for arg in $progfiles; do
  3085. $show "extracting global C symbols from \`$arg'"
  3086. $run eval "$NM $arg | $global_symbol_pipe >> '$nlist'"
  3087. done
  3088. if test -n "$exclude_expsyms"; then
  3089. $run eval 'egrep -v " ($exclude_expsyms)$" "$nlist" > "$nlist"T'
  3090. $run eval '$mv "$nlist"T "$nlist"'
  3091. fi
  3092. if test -n "$export_symbols_regex"; then
  3093. $run eval 'egrep -e "$export_symbols_regex" "$nlist" > "$nlist"T'
  3094. $run eval '$mv "$nlist"T "$nlist"'
  3095. fi
  3096. # Prepare the list of exported symbols
  3097. if test -z "$export_symbols"; then
  3098. export_symbols="$output_objdir/$output.exp"
  3099. $run $rm $export_symbols
  3100. $run eval "${SED} -n -e '/^: @PROGRAM@$/d' -e 's/^.* \(.*\)$/\1/p' "'< "$nlist" > "$export_symbols"'
  3101. else
  3102. $run eval "${SED} -e 's/\([][.*^$]\)/\\\1/g' -e 's/^/ /' -e 's/$/$/'"' < "$export_symbols" > "$output_objdir/$output.exp"'
  3103. $run eval 'grep -f "$output_objdir/$output.exp" < "$nlist" > "$nlist"T'
  3104. $run eval 'mv "$nlist"T "$nlist"'
  3105. fi
  3106. fi
  3107. for arg in $dlprefiles; do
  3108. $show "extracting global C symbols from \`$arg'"
  3109. name=`echo "$arg" | ${SED} -e 's%^.*/%%'`
  3110. $run eval 'echo ": $name " >> "$nlist"'
  3111. $run eval "$NM $arg | $global_symbol_pipe >> '$nlist'"
  3112. done
  3113. if test -z "$run"; then
  3114. # Make sure we have at least an empty file.
  3115. test -f "$nlist" || : > "$nlist"
  3116. if test -n "$exclude_expsyms"; then
  3117. egrep -v " ($exclude_expsyms)$" "$nlist" > "$nlist"T
  3118. $mv "$nlist"T "$nlist"
  3119. fi
  3120. # Try sorting and uniquifying the output.
  3121. if grep -v "^: " < "$nlist" |
  3122. if sort -k 3 </dev/null >/dev/null 2>&1; then
  3123. sort -k 3
  3124. else
  3125. sort +2
  3126. fi |
  3127. uniq > "$nlist"S; then
  3128. :
  3129. else
  3130. grep -v "^: " < "$nlist" > "$nlist"S
  3131. fi
  3132. if test -f "$nlist"S; then
  3133. eval "$global_symbol_to_cdecl"' < "$nlist"S >> "$output_objdir/$dlsyms"'
  3134. else
  3135. echo '/* NONE */' >> "$output_objdir/$dlsyms"
  3136. fi
  3137. $echo >> "$output_objdir/$dlsyms" "\
  3138. #undef lt_preloaded_symbols
  3139. #if defined (__STDC__) && __STDC__
  3140. # define lt_ptr void *
  3141. #else
  3142. # define lt_ptr char *
  3143. # define const
  3144. #endif
  3145. /* The mapping between symbol names and symbols. */
  3146. const struct {
  3147. const char *name;
  3148. lt_ptr address;
  3149. }
  3150. lt_preloaded_symbols[] =
  3151. {\
  3152. "
  3153. eval "$global_symbol_to_c_name_address" < "$nlist" >> "$output_objdir/$dlsyms"
  3154. $echo >> "$output_objdir/$dlsyms" "\
  3155. {0, (lt_ptr) 0}
  3156. };
  3157. /* This works around a problem in FreeBSD linker */
  3158. #ifdef FREEBSD_WORKAROUND
  3159. static const void *lt_preloaded_setup() {
  3160. return lt_preloaded_symbols;
  3161. }
  3162. #endif
  3163. #ifdef __cplusplus
  3164. }
  3165. #endif\
  3166. "
  3167. fi
  3168. pic_flag_for_symtable=
  3169. case $host in
  3170. # compiling the symbol table file with pic_flag works around
  3171. # a FreeBSD bug that causes programs to crash when -lm is
  3172. # linked before any other PIC object. But we must not use
  3173. # pic_flag when linking with -static. The problem exists in
  3174. # FreeBSD 2.2.6 and is fixed in FreeBSD 3.1.
  3175. *-*-freebsd2*|*-*-freebsd3.0*|*-*-freebsdelf3.0*)
  3176. case "$compile_command " in
  3177. *" -static "*) ;;
  3178. *) pic_flag_for_symtable=" $pic_flag -DPIC -DFREEBSD_WORKAROUND";;
  3179. esac;;
  3180. *-*-hpux*)
  3181. case "$compile_command " in
  3182. *" -static "*) ;;
  3183. *) pic_flag_for_symtable=" $pic_flag -DPIC";;
  3184. esac
  3185. esac
  3186. # Now compile the dynamic symbol file.
  3187. $show "(cd $output_objdir && $CC -c$no_builtin_flag$pic_flag_for_symtable \"$dlsyms\")"
  3188. $run eval '(cd $output_objdir && $CC -c$no_builtin_flag$pic_flag_for_symtable "$dlsyms")' || exit $?
  3189. # Clean up the generated files.
  3190. $show "$rm $output_objdir/$dlsyms $nlist ${nlist}S ${nlist}T"
  3191. $run $rm "$output_objdir/$dlsyms" "$nlist" "${nlist}S" "${nlist}T"
  3192. # Transform the symbol file into the correct name.
  3193. compile_command=`$echo "X$compile_command" | $Xsed -e "s%@SYMFILE@%$output_objdir/${outputname}S.${objext}%"`
  3194. finalize_command=`$echo "X$finalize_command" | $Xsed -e "s%@SYMFILE@%$output_objdir/${outputname}S.${objext}%"`
  3195. ;;
  3196. *)
  3197. $echo "$modename: unknown suffix for \`$dlsyms'" 1>&2
  3198. exit 1
  3199. ;;
  3200. esac
  3201. else
  3202. # We keep going just in case the user didn't refer to
  3203. # lt_preloaded_symbols. The linker will fail if global_symbol_pipe
  3204. # really was required.
  3205. # Nullify the symbol file.
  3206. compile_command=`$echo "X$compile_command" | $Xsed -e "s% @SYMFILE@%%"`
  3207. finalize_command=`$echo "X$finalize_command" | $Xsed -e "s% @SYMFILE@%%"`
  3208. fi
  3209. if test $need_relink = no || test "$build_libtool_libs" != yes; then
  3210. # Replace the output file specification.
  3211. compile_command=`$echo "X$compile_command" | $Xsed -e 's%@OUTPUT@%'"$output"'%g'`
  3212. link_command="$compile_command$compile_rpath"
  3213. # We have no uninstalled library dependencies, so finalize right now.
  3214. $show "$link_command"
  3215. $run eval "$link_command"
  3216. status=$?
  3217. # Delete the generated files.
  3218. if test -n "$dlsyms"; then
  3219. $show "$rm $output_objdir/${outputname}S.${objext}"
  3220. $run $rm "$output_objdir/${outputname}S.${objext}"
  3221. fi
  3222. exit $status
  3223. fi
  3224. if test -n "$shlibpath_var"; then
  3225. # We should set the shlibpath_var
  3226. rpath=
  3227. for dir in $temp_rpath; do
  3228. case $dir in
  3229. [\\/]* | [A-Za-z]:[\\/]*)
  3230. # Absolute path.
  3231. rpath="$rpath$dir:"
  3232. ;;
  3233. *)
  3234. # Relative path: add a thisdir entry.
  3235. rpath="$rpath\$thisdir/$dir:"
  3236. ;;
  3237. esac
  3238. done
  3239. temp_rpath="$rpath"
  3240. fi
  3241. if test -n "$compile_shlibpath$finalize_shlibpath"; then
  3242. compile_command="$shlibpath_var=\"$compile_shlibpath$finalize_shlibpath\$$shlibpath_var\" $compile_command"
  3243. fi
  3244. if test -n "$finalize_shlibpath"; then
  3245. finalize_command="$shlibpath_var=\"$finalize_shlibpath\$$shlibpath_var\" $finalize_command"
  3246. fi
  3247. compile_var=
  3248. finalize_var=
  3249. if test -n "$runpath_var"; then
  3250. if test -n "$perm_rpath"; then
  3251. # We should set the runpath_var.
  3252. rpath=
  3253. for dir in $perm_rpath; do
  3254. rpath="$rpath$dir:"
  3255. done
  3256. compile_var="$runpath_var=\"$rpath\$$runpath_var\" "
  3257. fi
  3258. if test -n "$finalize_perm_rpath"; then
  3259. # We should set the runpath_var.
  3260. rpath=
  3261. for dir in $finalize_perm_rpath; do
  3262. rpath="$rpath$dir:"
  3263. done
  3264. finalize_var="$runpath_var=\"$rpath\$$runpath_var\" "
  3265. fi
  3266. fi
  3267. if test "$no_install" = yes; then
  3268. # We don't need to create a wrapper script.
  3269. link_command="$compile_var$compile_command$compile_rpath"
  3270. # Replace the output file specification.
  3271. link_command=`$echo "X$link_command" | $Xsed -e 's%@OUTPUT@%'"$output"'%g'`
  3272. # Delete the old output file.
  3273. $run $rm $output
  3274. # Link the executable and exit
  3275. $show "$link_command"
  3276. $run eval "$link_command" || exit $?
  3277. exit 0
  3278. fi
  3279. if test "$hardcode_action" = relink; then
  3280. # Fast installation is not supported
  3281. link_command="$compile_var$compile_command$compile_rpath"
  3282. relink_command="$finalize_var$finalize_command$finalize_rpath"
  3283. $echo "$modename: warning: this platform does not like uninstalled shared libraries" 1>&2
  3284. $echo "$modename: \`$output' will be relinked during installation" 1>&2
  3285. else
  3286. if test "$fast_install" != no; then
  3287. link_command="$finalize_var$compile_command$finalize_rpath"
  3288. if test "$fast_install" = yes; then
  3289. relink_command=`$echo "X$compile_var$compile_command$compile_rpath" | $Xsed -e 's%@OUTPUT@%\$progdir/\$file%g'`
  3290. else
  3291. # fast_install is set to needless
  3292. relink_command=
  3293. fi
  3294. else
  3295. link_command="$compile_var$compile_command$compile_rpath"
  3296. relink_command="$finalize_var$finalize_command$finalize_rpath"
  3297. fi
  3298. fi
  3299. # Replace the output file specification.
  3300. link_command=`$echo "X$link_command" | $Xsed -e 's%@OUTPUT@%'"$output_objdir/$outputname"'%g'`
  3301. # Delete the old output files.
  3302. $run $rm $output $output_objdir/$outputname $output_objdir/lt-$outputname
  3303. $show "$link_command"
  3304. $run eval "$link_command" || exit $?
  3305. # Now create the wrapper script.
  3306. $show "creating $output"
  3307. # Quote the relink command for shipping.
  3308. if test -n "$relink_command"; then
  3309. # Preserve any variables that may affect compiler behavior
  3310. for var in $variables_saved_for_relink; do
  3311. if eval test -z \"\${$var+set}\"; then
  3312. relink_command="{ test -z \"\${$var+set}\" || unset $var || { $var=; export $var; }; }; $relink_command"
  3313. elif eval var_value=\$$var; test -z "$var_value"; then
  3314. relink_command="$var=; export $var; $relink_command"
  3315. else
  3316. var_value=`$echo "X$var_value" | $Xsed -e "$sed_quote_subst"`
  3317. relink_command="$var=\"$var_value\"; export $var; $relink_command"
  3318. fi
  3319. done
  3320. relink_command="(cd `pwd`; $relink_command)"
  3321. relink_command=`$echo "X$relink_command" | $Xsed -e "$sed_quote_subst"`
  3322. fi
  3323. # Quote $echo for shipping.
  3324. if test "X$echo" = "X$SHELL $0 --fallback-echo"; then
  3325. case $0 in
  3326. [\\/]* | [A-Za-z]:[\\/]*) qecho="$SHELL $0 --fallback-echo";;
  3327. *) qecho="$SHELL `pwd`/$0 --fallback-echo";;
  3328. esac
  3329. qecho=`$echo "X$qecho" | $Xsed -e "$sed_quote_subst"`
  3330. else
  3331. qecho=`$echo "X$echo" | $Xsed -e "$sed_quote_subst"`
  3332. fi
  3333. # Only actually do things if our run command is non-null.
  3334. if test -z "$run"; then
  3335. # win32 will think the script is a binary if it has
  3336. # a .exe suffix, so we strip it off here.
  3337. case $output in
  3338. *.exe) output=`echo $output|${SED} 's,.exe$,,'` ;;
  3339. esac
  3340. # test for cygwin because mv fails w/o .exe extensions
  3341. case $host in
  3342. *cygwin*) exeext=.exe ;;
  3343. *) exeext= ;;
  3344. esac
  3345. $rm $output
  3346. trap "$rm $output; exit 1" 1 2 15
  3347. $echo > $output "\
  3348. #! $SHELL
  3349. # $output - temporary wrapper script for $objdir/$outputname
  3350. # Generated by $PROGRAM - GNU $PACKAGE $VERSION$TIMESTAMP
  3351. #
  3352. # The $output program cannot be directly executed until all the libtool
  3353. # libraries that it depends on are installed.
  3354. #
  3355. # This wrapper script should never be moved out of the build directory.
  3356. # If it is, it will not operate correctly.
  3357. # Sed substitution that helps us do robust quoting. It backslashifies
  3358. # metacharacters that are still active within double-quoted strings.
  3359. Xsed="${SED}"' -e 1s/^X//'
  3360. sed_quote_subst='$sed_quote_subst'
  3361. # The HP-UX ksh and POSIX shell print the target directory to stdout
  3362. # if CDPATH is set.
  3363. if test \"\${CDPATH+set}\" = set; then CDPATH=:; export CDPATH; fi
  3364. relink_command=\"$relink_command\"
  3365. # This environment variable determines our operation mode.
  3366. if test \"\$libtool_install_magic\" = \"$magic\"; then
  3367. # install mode needs the following variable:
  3368. notinst_deplibs='$notinst_deplibs'
  3369. else
  3370. # When we are sourced in execute mode, \$file and \$echo are already set.
  3371. if test \"\$libtool_execute_magic\" != \"$magic\"; then
  3372. echo=\"$qecho\"
  3373. file=\"\$0\"
  3374. # Make sure echo works.
  3375. if test \"X\$1\" = X--no-reexec; then
  3376. # Discard the --no-reexec flag, and continue.
  3377. shift
  3378. elif test \"X\`(\$echo '\t') 2>/dev/null\`\" = 'X\t'; then
  3379. # Yippee, \$echo works!
  3380. :
  3381. else
  3382. # Restart under the correct shell, and then maybe \$echo will work.
  3383. exec $SHELL \"\$0\" --no-reexec \${1+\"\$@\"}
  3384. fi
  3385. fi\
  3386. "
  3387. $echo >> $output "\
  3388. # Find the directory that this script lives in.
  3389. thisdir=\`\$echo \"X\$file\" | \$Xsed -e 's%/[^/]*$%%'\`
  3390. test \"x\$thisdir\" = \"x\$file\" && thisdir=.
  3391. # Follow symbolic links until we get to the real thisdir.
  3392. file=\`ls -ld \"\$file\" | ${SED} -n 's/.*-> //p'\`
  3393. while test -n \"\$file\"; do
  3394. destdir=\`\$echo \"X\$file\" | \$Xsed -e 's%/[^/]*\$%%'\`
  3395. # If there was a directory component, then change thisdir.
  3396. if test \"x\$destdir\" != \"x\$file\"; then
  3397. case \"\$destdir\" in
  3398. [\\\\/]* | [A-Za-z]:[\\\\/]*) thisdir=\"\$destdir\" ;;
  3399. *) thisdir=\"\$thisdir/\$destdir\" ;;
  3400. esac
  3401. fi
  3402. file=\`\$echo \"X\$file\" | \$Xsed -e 's%^.*/%%'\`
  3403. file=\`ls -ld \"\$thisdir/\$file\" | ${SED} -n 's/.*-> //p'\`
  3404. done
  3405. # Try to get the absolute directory name.
  3406. absdir=\`cd \"\$thisdir\" && pwd\`
  3407. test -n \"\$absdir\" && thisdir=\"\$absdir\"
  3408. "
  3409. if test "$fast_install" = yes; then
  3410. echo >> $output "\
  3411. program=lt-'$outputname'$exeext
  3412. progdir=\"\$thisdir/$objdir\"
  3413. if test ! -f \"\$progdir/\$program\" || \\
  3414. { file=\`ls -1dt \"\$progdir/\$program\" \"\$progdir/../\$program\" 2>/dev/null | ${SED} 1q\`; \\
  3415. test \"X\$file\" != \"X\$progdir/\$program\"; }; then
  3416. file=\"\$\$-\$program\"
  3417. if test ! -d \"\$progdir\"; then
  3418. $mkdir \"\$progdir\"
  3419. else
  3420. $rm \"\$progdir/\$file\"
  3421. fi"
  3422. echo >> $output "\
  3423. # relink executable if necessary
  3424. if test -n \"\$relink_command\"; then
  3425. if relink_command_output=\`eval \$relink_command 2>&1\`; then :
  3426. else
  3427. $echo \"\$relink_command_output\" >&2
  3428. $rm \"\$progdir/\$file\"
  3429. exit 1
  3430. fi
  3431. fi
  3432. $mv \"\$progdir/\$file\" \"\$progdir/\$program\" 2>/dev/null ||
  3433. { $rm \"\$progdir/\$program\";
  3434. $mv \"\$progdir/\$file\" \"\$progdir/\$program\"; }
  3435. $rm \"\$progdir/\$file\"
  3436. fi"
  3437. else
  3438. echo >> $output "\
  3439. program='$outputname'
  3440. progdir=\"\$thisdir/$objdir\"
  3441. "
  3442. fi
  3443. echo >> $output "\
  3444. if test -f \"\$progdir/\$program\"; then"
  3445. # Export our shlibpath_var if we have one.
  3446. if test "$shlibpath_overrides_runpath" = yes && test -n "$shlibpath_var" && test -n "$temp_rpath"; then
  3447. $echo >> $output "\
  3448. # Add our own library path to $shlibpath_var
  3449. $shlibpath_var=\"$temp_rpath\$$shlibpath_var\"
  3450. # Some systems cannot cope with colon-terminated $shlibpath_var
  3451. # The second colon is a workaround for a bug in BeOS R4 ${SED}
  3452. $shlibpath_var=\`\$echo \"X\$$shlibpath_var\" | \$Xsed -e 's/::*\$//'\`
  3453. export $shlibpath_var
  3454. "
  3455. fi
  3456. # fixup the dll searchpath if we need to.
  3457. if test -n "$dllsearchpath"; then
  3458. $echo >> $output "\
  3459. # Add the dll search path components to the executable PATH
  3460. PATH=$dllsearchpath:\$PATH
  3461. "
  3462. fi
  3463. $echo >> $output "\
  3464. if test \"\$libtool_execute_magic\" != \"$magic\"; then
  3465. # Run the actual program with our arguments.
  3466. "
  3467. case $host in
  3468. # win32 systems need to use the prog path for dll
  3469. # lookup to work
  3470. *-*-cygwin* | *-*-pw32*)
  3471. $echo >> $output "\
  3472. exec \$progdir/\$program \${1+\"\$@\"}
  3473. "
  3474. ;;
  3475. # Backslashes separate directories on plain windows
  3476. *-*-mingw | *-*-os2*)
  3477. $echo >> $output "\
  3478. exec \$progdir\\\\\$program \${1+\"\$@\"}
  3479. "
  3480. ;;
  3481. *)
  3482. $echo >> $output "\
  3483. # Export the path to the program.
  3484. PATH=\"\$progdir:\$PATH\"
  3485. export PATH
  3486. exec \$program \${1+\"\$@\"}
  3487. "
  3488. ;;
  3489. esac
  3490. $echo >> $output "\
  3491. \$echo \"\$0: cannot exec \$program \${1+\"\$@\"}\"
  3492. exit 1
  3493. fi
  3494. else
  3495. # The program doesn't exist.
  3496. \$echo \"\$0: error: \$progdir/\$program does not exist\" 1>&2
  3497. \$echo \"This script is just a wrapper for \$program.\" 1>&2
  3498. echo \"See the $PACKAGE documentation for more information.\" 1>&2
  3499. exit 1
  3500. fi
  3501. fi\
  3502. "
  3503. chmod +x $output
  3504. fi
  3505. exit 0
  3506. ;;
  3507. esac
  3508. # See if we need to build an old-fashioned archive.
  3509. for oldlib in $oldlibs; do
  3510. if test "$build_libtool_libs" = convenience; then
  3511. oldobjs="$libobjs_save"
  3512. addlibs="$convenience"
  3513. build_libtool_libs=no
  3514. else
  3515. if test "$build_libtool_libs" = module; then
  3516. oldobjs="$libobjs_save"
  3517. build_libtool_libs=no
  3518. else
  3519. oldobjs="$objs$old_deplibs "`$echo "X$libobjs_save" | $SP2NL | $Xsed -e '/\.'${libext}'$/d' -e '/\.lib$/d' -e "$lo2o" | $NL2SP`
  3520. fi
  3521. addlibs="$old_convenience"
  3522. fi
  3523. if test -n "$addlibs"; then
  3524. gentop="$output_objdir/${outputname}x"
  3525. $show "${rm}r $gentop"
  3526. $run ${rm}r "$gentop"
  3527. $show "mkdir $gentop"
  3528. $run mkdir "$gentop"
  3529. status=$?
  3530. if test $status -ne 0 && test ! -d "$gentop"; then
  3531. exit $status
  3532. fi
  3533. generated="$generated $gentop"
  3534. # Add in members from convenience archives.
  3535. for xlib in $addlibs; do
  3536. # Extract the objects.
  3537. case $xlib in
  3538. [\\/]* | [A-Za-z]:[\\/]*) xabs="$xlib" ;;
  3539. *) xabs=`pwd`"/$xlib" ;;
  3540. esac
  3541. xlib=`$echo "X$xlib" | $Xsed -e 's%^.*/%%'`
  3542. xdir="$gentop/$xlib"
  3543. $show "${rm}r $xdir"
  3544. $run ${rm}r "$xdir"
  3545. $show "mkdir $xdir"
  3546. $run mkdir "$xdir"
  3547. status=$?
  3548. if test $status -ne 0 && test ! -d "$xdir"; then
  3549. exit $status
  3550. fi
  3551. $show "(cd $xdir && $AR x $xabs)"
  3552. $run eval "(cd \$xdir && $AR x \$xabs)" || exit $?
  3553. oldobjs="$oldobjs "`find $xdir -name \*.${objext} -print -o -name \*.lo -print | $NL2SP`
  3554. done
  3555. fi
  3556. # Do each command in the archive commands.
  3557. if test -n "$old_archive_from_new_cmds" && test "$build_libtool_libs" = yes; then
  3558. eval cmds=\"$old_archive_from_new_cmds\"
  3559. else
  3560. # Ensure that we have .o objects in place in case we decided
  3561. # not to build a shared library, and have fallen back to building
  3562. # static libs even though --disable-static was passed!
  3563. for oldobj in $oldobjs; do
  3564. if test ! -f $oldobj; then
  3565. xdir=`$echo "X$oldobj" | $Xsed -e 's%/[^/]*$%%'`
  3566. if test "X$xdir" = "X$oldobj"; then
  3567. xdir="."
  3568. else
  3569. xdir="$xdir"
  3570. fi
  3571. baseobj=`$echo "X$oldobj" | $Xsed -e 's%^.*/%%'`
  3572. obj=`$echo "X$baseobj" | $Xsed -e "$o2lo"`
  3573. $show "(cd $xdir && ${LN_S} $obj $baseobj)"
  3574. $run eval '(cd $xdir && ${LN_S} $obj $baseobj)' || exit $?
  3575. fi
  3576. done
  3577. eval cmds=\"$old_archive_cmds\"
  3578. fi
  3579. save_ifs="$IFS"; IFS='~'
  3580. for cmd in $cmds; do
  3581. IFS="$save_ifs"
  3582. $show "$cmd"
  3583. $run eval "$cmd" || exit $?
  3584. done
  3585. IFS="$save_ifs"
  3586. done
  3587. if test -n "$generated"; then
  3588. $show "${rm}r$generated"
  3589. $run ${rm}r$generated
  3590. fi
  3591. # Now create the libtool archive.
  3592. case $output in
  3593. *.la)
  3594. old_library=
  3595. test "$build_old_libs" = yes && old_library="$libname.$libext"
  3596. $show "creating $output"
  3597. # Preserve any variables that may affect compiler behavior
  3598. for var in $variables_saved_for_relink; do
  3599. if eval test -z \"\${$var+set}\"; then
  3600. relink_command="{ test -z \"\${$var+set}\" || unset $var || { $var=; export $var; }; }; $relink_command"
  3601. elif eval var_value=\$$var; test -z "$var_value"; then
  3602. relink_command="$var=; export $var; $relink_command"
  3603. else
  3604. var_value=`$echo "X$var_value" | $Xsed -e "$sed_quote_subst"`
  3605. relink_command="$var=\"$var_value\"; export $var; $relink_command"
  3606. fi
  3607. done
  3608. # Quote the link command for shipping.
  3609. relink_command="(cd `pwd`; $SHELL $0 --mode=relink $libtool_args @inst_prefix_dir@)"
  3610. relink_command=`$echo "X$relink_command" | $Xsed -e "$sed_quote_subst"`
  3611. # Only create the output if not a dry run.
  3612. if test -z "$run"; then
  3613. for installed in no yes; do
  3614. if test "$installed" = yes; then
  3615. if test -z "$install_libdir"; then
  3616. break
  3617. fi
  3618. output="$output_objdir/$outputname"i
  3619. # Replace all uninstalled libtool libraries with the installed ones
  3620. newdependency_libs=
  3621. for deplib in $dependency_libs; do
  3622. case $deplib in
  3623. *.la)
  3624. name=`$echo "X$deplib" | $Xsed -e 's%^.*/%%'`
  3625. eval libdir=`${SED} -n -e 's/^libdir=\(.*\)$/\1/p' $deplib`
  3626. if test -z "$libdir"; then
  3627. $echo "$modename: \`$deplib' is not a valid libtool archive" 1>&2
  3628. exit 1
  3629. fi
  3630. newdependency_libs="$newdependency_libs $libdir/$name"
  3631. ;;
  3632. *) newdependency_libs="$newdependency_libs $deplib" ;;
  3633. esac
  3634. done
  3635. dependency_libs="$newdependency_libs"
  3636. newdlfiles=
  3637. for lib in $dlfiles; do
  3638. name=`$echo "X$lib" | $Xsed -e 's%^.*/%%'`
  3639. eval libdir=`${SED} -n -e 's/^libdir=\(.*\)$/\1/p' $lib`
  3640. if test -z "$libdir"; then
  3641. $echo "$modename: \`$lib' is not a valid libtool archive" 1>&2
  3642. exit 1
  3643. fi
  3644. newdlfiles="$newdlfiles $libdir/$name"
  3645. done
  3646. dlfiles="$newdlfiles"
  3647. newdlprefiles=
  3648. for lib in $dlprefiles; do
  3649. name=`$echo "X$lib" | $Xsed -e 's%^.*/%%'`
  3650. eval libdir=`${SED} -n -e 's/^libdir=\(.*\)$/\1/p' $lib`
  3651. if test -z "$libdir"; then
  3652. $echo "$modename: \`$lib' is not a valid libtool archive" 1>&2
  3653. exit 1
  3654. fi
  3655. newdlprefiles="$newdlprefiles $libdir/$name"
  3656. done
  3657. dlprefiles="$newdlprefiles"
  3658. fi
  3659. $rm $output
  3660. # place dlname in correct position for cygwin
  3661. tdlname=$dlname
  3662. case $host,$output,$installed,$module,$dlname in
  3663. *cygwin*,*lai,yes,no,*.dll) tdlname=../bin/$dlname ;;
  3664. esac
  3665. $echo > $output "\
  3666. # $outputname - a libtool library file
  3667. # Generated by $PROGRAM - GNU $PACKAGE $VERSION$TIMESTAMP
  3668. #
  3669. # Please DO NOT delete this file!
  3670. # It is necessary for linking the library.
  3671. # The name that we can dlopen(3).
  3672. dlname='$tdlname'
  3673. # Names of this library.
  3674. library_names='$library_names'
  3675. # The name of the static archive.
  3676. old_library='$old_library'
  3677. # Libraries that this one depends upon.
  3678. dependency_libs='$dependency_libs'
  3679. # Version information for $libname.
  3680. current=$current
  3681. age=$age
  3682. revision=$revision
  3683. # Is this an already installed library?
  3684. installed=$installed
  3685. # Files to dlopen/dlpreopen
  3686. dlopen='$dlfiles'
  3687. dlpreopen='$dlprefiles'
  3688. # Directory that this library needs to be installed in:
  3689. libdir='$install_libdir'"
  3690. if test "$installed" = no && test $need_relink = yes; then
  3691. $echo >> $output "\
  3692. relink_command=\"$relink_command\""
  3693. fi
  3694. done
  3695. fi
  3696. # Do a symbolic link so that the libtool archive can be found in
  3697. # LD_LIBRARY_PATH before the program is installed.
  3698. $show "(cd $output_objdir && $rm $outputname && $LN_S ../$outputname $outputname)"
  3699. $run eval '(cd $output_objdir && $rm $outputname && $LN_S ../$outputname $outputname)' || exit $?
  3700. ;;
  3701. esac
  3702. exit 0
  3703. ;;
  3704. # libtool install mode
  3705. install)
  3706. modename="$modename: install"
  3707. # There may be an optional sh(1) argument at the beginning of
  3708. # install_prog (especially on Windows NT).
  3709. if test "$nonopt" = "$SHELL" || test "$nonopt" = /bin/sh ||
  3710. # Allow the use of GNU shtool's install command.
  3711. $echo "X$nonopt" | $Xsed | grep shtool > /dev/null; then
  3712. # Aesthetically quote it.
  3713. arg=`$echo "X$nonopt" | $Xsed -e "$sed_quote_subst"`
  3714. case $arg in
  3715. *[\[\~\#\^\&\*\(\)\{\}\|\;\<\>\?\'\ \ ]*|*]*)
  3716. arg="\"$arg\""
  3717. ;;
  3718. esac
  3719. install_prog="$arg "
  3720. arg="$1"
  3721. shift
  3722. else
  3723. install_prog=
  3724. arg="$nonopt"
  3725. fi
  3726. # The real first argument should be the name of the installation program.
  3727. # Aesthetically quote it.
  3728. arg=`$echo "X$arg" | $Xsed -e "$sed_quote_subst"`
  3729. case $arg in
  3730. *[\[\~\#\^\&\*\(\)\{\}\|\;\<\>\?\'\ \ ]*|*]*)
  3731. arg="\"$arg\""
  3732. ;;
  3733. esac
  3734. install_prog="$install_prog$arg"
  3735. # We need to accept at least all the BSD install flags.
  3736. dest=
  3737. files=
  3738. opts=
  3739. prev=
  3740. install_type=
  3741. isdir=no
  3742. stripme=
  3743. for arg
  3744. do
  3745. if test -n "$dest"; then
  3746. files="$files $dest"
  3747. dest="$arg"
  3748. continue
  3749. fi
  3750. case $arg in
  3751. -d) isdir=yes ;;
  3752. -f) prev="-f" ;;
  3753. -g) prev="-g" ;;
  3754. -m) prev="-m" ;;
  3755. -o) prev="-o" ;;
  3756. -s)
  3757. stripme=" -s"
  3758. continue
  3759. ;;
  3760. -*) ;;
  3761. *)
  3762. # If the previous option needed an argument, then skip it.
  3763. if test -n "$prev"; then
  3764. prev=
  3765. else
  3766. dest="$arg"
  3767. continue
  3768. fi
  3769. ;;
  3770. esac
  3771. # Aesthetically quote the argument.
  3772. arg=`$echo "X$arg" | $Xsed -e "$sed_quote_subst"`
  3773. case $arg in
  3774. *[\[\~\#\^\&\*\(\)\{\}\|\;\<\>\?\'\ \ ]*|*]*)
  3775. arg="\"$arg\""
  3776. ;;
  3777. esac
  3778. install_prog="$install_prog $arg"
  3779. done
  3780. if test -z "$install_prog"; then
  3781. $echo "$modename: you must specify an install program" 1>&2
  3782. $echo "$help" 1>&2
  3783. exit 1
  3784. fi
  3785. if test -n "$prev"; then
  3786. $echo "$modename: the \`$prev' option requires an argument" 1>&2
  3787. $echo "$help" 1>&2
  3788. exit 1
  3789. fi
  3790. if test -z "$files"; then
  3791. if test -z "$dest"; then
  3792. $echo "$modename: no file or destination specified" 1>&2
  3793. else
  3794. $echo "$modename: you must specify a destination" 1>&2
  3795. fi
  3796. $echo "$help" 1>&2
  3797. exit 1
  3798. fi
  3799. # Strip any trailing slash from the destination.
  3800. dest=`$echo "X$dest" | $Xsed -e 's%/$%%'`
  3801. # Check to see that the destination is a directory.
  3802. test -d "$dest" && isdir=yes
  3803. if test "$isdir" = yes; then
  3804. destdir="$dest"
  3805. destname=
  3806. else
  3807. destdir=`$echo "X$dest" | $Xsed -e 's%/[^/]*$%%'`
  3808. test "X$destdir" = "X$dest" && destdir=.
  3809. destname=`$echo "X$dest" | $Xsed -e 's%^.*/%%'`
  3810. # Not a directory, so check to see that there is only one file specified.
  3811. set dummy $files
  3812. if test $# -gt 2; then
  3813. $echo "$modename: \`$dest' is not a directory" 1>&2
  3814. $echo "$help" 1>&2
  3815. exit 1
  3816. fi
  3817. fi
  3818. case $destdir in
  3819. [\\/]* | [A-Za-z]:[\\/]*) ;;
  3820. *)
  3821. for file in $files; do
  3822. case $file in
  3823. *.lo) ;;
  3824. *)
  3825. $echo "$modename: \`$destdir' must be an absolute directory name" 1>&2
  3826. $echo "$help" 1>&2
  3827. exit 1
  3828. ;;
  3829. esac
  3830. done
  3831. ;;
  3832. esac
  3833. # This variable tells wrapper scripts just to set variables rather
  3834. # than running their programs.
  3835. libtool_install_magic="$magic"
  3836. staticlibs=
  3837. future_libdirs=
  3838. current_libdirs=
  3839. for file in $files; do
  3840. # Do each installation.
  3841. case $file in
  3842. *.$libext)
  3843. # Do the static libraries later.
  3844. staticlibs="$staticlibs $file"
  3845. ;;
  3846. *.la)
  3847. # Check to see that this really is a libtool archive.
  3848. if (${SED} -e '2q' $file | egrep "^# Generated by .*$PACKAGE") >/dev/null 2>&1; then :
  3849. else
  3850. $echo "$modename: \`$file' is not a valid libtool archive" 1>&2
  3851. $echo "$help" 1>&2
  3852. exit 1
  3853. fi
  3854. library_names=
  3855. old_library=
  3856. relink_command=
  3857. # If there is no directory component, then add one.
  3858. case $file in
  3859. */* | *\\*) . $file ;;
  3860. *) . ./$file ;;
  3861. esac
  3862. # Add the libdir to current_libdirs if it is the destination.
  3863. if test "X$destdir" = "X$libdir"; then
  3864. case "$current_libdirs " in
  3865. *" $libdir "*) ;;
  3866. *) current_libdirs="$current_libdirs $libdir" ;;
  3867. esac
  3868. else
  3869. # Note the libdir as a future libdir.
  3870. case "$future_libdirs " in
  3871. *" $libdir "*) ;;
  3872. *) future_libdirs="$future_libdirs $libdir" ;;
  3873. esac
  3874. fi
  3875. dir=`$echo "X$file" | $Xsed -e 's%/[^/]*$%%'`/
  3876. test "X$dir" = "X$file/" && dir=
  3877. dir="$dir$objdir"
  3878. if test -n "$relink_command"; then
  3879. # Determine the prefix the user has applied to our future dir.
  3880. inst_prefix_dir=`$echo "$destdir" | sed "s%$libdir\$%%"`
  3881. # Don't allow the user to place us outside of our expected
  3882. # location b/c this prevents finding dependent libraries that
  3883. # are installed to the same prefix.
  3884. if test "$inst_prefix_dir" = "$destdir"; then
  3885. $echo "$modename: error: cannot install \`$file' to a directory not ending in $libdir" 1>&2
  3886. exit 1
  3887. fi
  3888. if test -n "$inst_prefix_dir"; then
  3889. # Stick the inst_prefix_dir data into the link command.
  3890. relink_command=`$echo "$relink_command" | sed "s%@inst_prefix_dir@%-inst-prefix-dir $inst_prefix_dir%"`
  3891. else
  3892. relink_command=`$echo "$relink_command" | sed "s%@inst_prefix_dir@%%"`
  3893. fi
  3894. $echo "$modename: warning: relinking \`$file'" 1>&2
  3895. $show "$relink_command"
  3896. if $run eval "$relink_command"; then :
  3897. else
  3898. $echo "$modename: error: relink \`$file' with the above command before installing it" 1>&2
  3899. continue
  3900. fi
  3901. fi
  3902. # See the names of the shared library.
  3903. set dummy $library_names
  3904. if test -n "$2"; then
  3905. realname="$2"
  3906. shift
  3907. shift
  3908. srcname="$realname"
  3909. test -n "$relink_command" && srcname="$realname"T
  3910. # Install the shared library and build the symlinks.
  3911. $show "$install_prog $dir/$srcname $destdir/$realname"
  3912. $run eval "$install_prog $dir/$srcname $destdir/$realname" || exit $?
  3913. if test -n "$stripme" && test -n "$striplib"; then
  3914. $show "$striplib $destdir/$realname"
  3915. $run eval "$striplib $destdir/$realname" || exit $?
  3916. fi
  3917. if test $# -gt 0; then
  3918. # Delete the old symlinks, and create new ones.
  3919. for linkname
  3920. do
  3921. if test "$linkname" != "$realname"; then
  3922. $show "(cd $destdir && $rm $linkname && $LN_S $realname $linkname)"
  3923. $run eval "(cd $destdir && $rm $linkname && $LN_S $realname $linkname)"
  3924. fi
  3925. done
  3926. fi
  3927. # Do each command in the postinstall commands.
  3928. lib="$destdir/$realname"
  3929. eval cmds=\"$postinstall_cmds\"
  3930. save_ifs="$IFS"; IFS='~'
  3931. for cmd in $cmds; do
  3932. IFS="$save_ifs"
  3933. $show "$cmd"
  3934. $run eval "$cmd" || exit $?
  3935. done
  3936. IFS="$save_ifs"
  3937. fi
  3938. # Install the pseudo-library for information purposes.
  3939. name=`$echo "X$file" | $Xsed -e 's%^.*/%%'`
  3940. instname="$dir/$name"i
  3941. $show "$install_prog $instname $destdir/$name"
  3942. $run eval "$install_prog $instname $destdir/$name" || exit $?
  3943. # Maybe install the static library, too.
  3944. test -n "$old_library" && staticlibs="$staticlibs $dir/$old_library"
  3945. ;;
  3946. *.lo)
  3947. # Install (i.e. copy) a libtool object.
  3948. # Figure out destination file name, if it wasn't already specified.
  3949. if test -n "$destname"; then
  3950. destfile="$destdir/$destname"
  3951. else
  3952. destfile=`$echo "X$file" | $Xsed -e 's%^.*/%%'`
  3953. destfile="$destdir/$destfile"
  3954. fi
  3955. # Deduce the name of the destination old-style object file.
  3956. case $destfile in
  3957. *.lo)
  3958. staticdest=`$echo "X$destfile" | $Xsed -e "$lo2o"`
  3959. ;;
  3960. *.$objext)
  3961. staticdest="$destfile"
  3962. destfile=
  3963. ;;
  3964. *)
  3965. $echo "$modename: cannot copy a libtool object to \`$destfile'" 1>&2
  3966. $echo "$help" 1>&2
  3967. exit 1
  3968. ;;
  3969. esac
  3970. # Install the libtool object if requested.
  3971. if test -n "$destfile"; then
  3972. $show "$install_prog $file $destfile"
  3973. $run eval "$install_prog $file $destfile" || exit $?
  3974. fi
  3975. # Install the old object if enabled.
  3976. if test "$build_old_libs" = yes; then
  3977. # Deduce the name of the old-style object file.
  3978. staticobj=`$echo "X$file" | $Xsed -e "$lo2o"`
  3979. $show "$install_prog $staticobj $staticdest"
  3980. $run eval "$install_prog \$staticobj \$staticdest" || exit $?
  3981. fi
  3982. exit 0
  3983. ;;
  3984. *)
  3985. # Figure out destination file name, if it wasn't already specified.
  3986. if test -n "$destname"; then
  3987. destfile="$destdir/$destname"
  3988. else
  3989. destfile=`$echo "X$file" | $Xsed -e 's%^.*/%%'`
  3990. destfile="$destdir/$destfile"
  3991. fi
  3992. # Do a test to see if this is really a libtool program.
  3993. case $host in
  3994. *cygwin*|*mingw*)
  3995. wrapper=`echo $file | ${SED} -e 's,.exe$,,'`
  3996. ;;
  3997. *)
  3998. wrapper=$file
  3999. ;;
  4000. esac
  4001. if (${SED} -e '4q' $wrapper | egrep "^# Generated by .*$PACKAGE")>/dev/null 2>&1; then
  4002. notinst_deplibs=
  4003. relink_command=
  4004. # If there is no directory component, then add one.
  4005. case $file in
  4006. */* | *\\*) . $wrapper ;;
  4007. *) . ./$wrapper ;;
  4008. esac
  4009. # Check the variables that should have been set.
  4010. if test -z "$notinst_deplibs"; then
  4011. $echo "$modename: invalid libtool wrapper script \`$wrapper'" 1>&2
  4012. exit 1
  4013. fi
  4014. finalize=yes
  4015. for lib in $notinst_deplibs; do
  4016. # Check to see that each library is installed.
  4017. libdir=
  4018. if test -f "$lib"; then
  4019. # If there is no directory component, then add one.
  4020. case $lib in
  4021. */* | *\\*) . $lib ;;
  4022. *) . ./$lib ;;
  4023. esac
  4024. fi
  4025. libfile="$libdir/"`$echo "X$lib" | $Xsed -e 's%^.*/%%g'` ### testsuite: skip nested quoting test
  4026. if test -n "$libdir" && test ! -f "$libfile"; then
  4027. $echo "$modename: warning: \`$lib' has not been installed in \`$libdir'" 1>&2
  4028. finalize=no
  4029. fi
  4030. done
  4031. relink_command=
  4032. # If there is no directory component, then add one.
  4033. case $file in
  4034. */* | *\\*) . $wrapper ;;
  4035. *) . ./$wrapper ;;
  4036. esac
  4037. outputname=
  4038. if test "$fast_install" = no && test -n "$relink_command"; then
  4039. if test "$finalize" = yes && test -z "$run"; then
  4040. tmpdir="/tmp"
  4041. test -n "$TMPDIR" && tmpdir="$TMPDIR"
  4042. tmpdir=`mktemp -d $tmpdir/libtool-XXXXXX 2> /dev/null`
  4043. if test $? = 0 ; then :
  4044. else
  4045. tmpdir="$tmpdir/libtool-$$"
  4046. fi
  4047. if $mkdir -p "$tmpdir" && chmod 700 "$tmpdir"; then :
  4048. else
  4049. $echo "$modename: error: cannot create temporary directory \`$tmpdir'" 1>&2
  4050. continue
  4051. fi
  4052. file=`$echo "X$file" | $Xsed -e 's%^.*/%%'`
  4053. outputname="$tmpdir/$file"
  4054. # Replace the output file specification.
  4055. relink_command=`$echo "X$relink_command" | $Xsed -e 's%@OUTPUT@%'"$outputname"'%g'`
  4056. $show "$relink_command"
  4057. if $run eval "$relink_command"; then :
  4058. else
  4059. $echo "$modename: error: relink \`$file' with the above command before installing it" 1>&2
  4060. ${rm}r "$tmpdir"
  4061. continue
  4062. fi
  4063. file="$outputname"
  4064. else
  4065. $echo "$modename: warning: cannot relink \`$file'" 1>&2
  4066. fi
  4067. else
  4068. # Install the binary that we compiled earlier.
  4069. file=`$echo "X$file" | $Xsed -e "s%\([^/]*\)$%$objdir/\1%"`
  4070. fi
  4071. fi
  4072. # remove .exe since cygwin /usr/bin/install will append another
  4073. # one anyways
  4074. case $install_prog,$host in
  4075. /usr/bin/install*,*cygwin*)
  4076. case $file:$destfile in
  4077. *.exe:*.exe)
  4078. # this is ok
  4079. ;;
  4080. *.exe:*)
  4081. destfile=$destfile.exe
  4082. ;;
  4083. *:*.exe)
  4084. destfile=`echo $destfile | ${SED} -e 's,.exe$,,'`
  4085. ;;
  4086. esac
  4087. ;;
  4088. esac
  4089. $show "$install_prog$stripme $file $destfile"
  4090. $run eval "$install_prog\$stripme \$file \$destfile" || exit $?
  4091. test -n "$outputname" && ${rm}r "$tmpdir"
  4092. ;;
  4093. esac
  4094. done
  4095. for file in $staticlibs; do
  4096. name=`$echo "X$file" | $Xsed -e 's%^.*/%%'`
  4097. # Set up the ranlib parameters.
  4098. oldlib="$destdir/$name"
  4099. $show "$install_prog $file $oldlib"
  4100. $run eval "$install_prog \$file \$oldlib" || exit $?
  4101. if test -n "$stripme" && test -n "$striplib"; then
  4102. $show "$old_striplib $oldlib"
  4103. $run eval "$old_striplib $oldlib" || exit $?
  4104. fi
  4105. # Do each command in the postinstall commands.
  4106. eval cmds=\"$old_postinstall_cmds\"
  4107. save_ifs="$IFS"; IFS='~'
  4108. for cmd in $cmds; do
  4109. IFS="$save_ifs"
  4110. $show "$cmd"
  4111. $run eval "$cmd" || exit $?
  4112. done
  4113. IFS="$save_ifs"
  4114. done
  4115. if test -n "$future_libdirs"; then
  4116. $echo "$modename: warning: remember to run \`$progname --finish$future_libdirs'" 1>&2
  4117. fi
  4118. if test -n "$current_libdirs"; then
  4119. # Maybe just do a dry run.
  4120. test -n "$run" && current_libdirs=" -n$current_libdirs"
  4121. exec_cmd='$SHELL $0 --finish$current_libdirs'
  4122. else
  4123. exit 0
  4124. fi
  4125. ;;
  4126. # libtool finish mode
  4127. finish)
  4128. modename="$modename: finish"
  4129. libdirs="$nonopt"
  4130. admincmds=
  4131. if test -n "$finish_cmds$finish_eval" && test -n "$libdirs"; then
  4132. for dir
  4133. do
  4134. libdirs="$libdirs $dir"
  4135. done
  4136. for libdir in $libdirs; do
  4137. if test -n "$finish_cmds"; then
  4138. # Do each command in the finish commands.
  4139. eval cmds=\"$finish_cmds\"
  4140. save_ifs="$IFS"; IFS='~'
  4141. for cmd in $cmds; do
  4142. IFS="$save_ifs"
  4143. $show "$cmd"
  4144. $run eval "$cmd" || admincmds="$admincmds
  4145. $cmd"
  4146. done
  4147. IFS="$save_ifs"
  4148. fi
  4149. if test -n "$finish_eval"; then
  4150. # Do the single finish_eval.
  4151. eval cmds=\"$finish_eval\"
  4152. $run eval "$cmds" || admincmds="$admincmds
  4153. $cmds"
  4154. fi
  4155. done
  4156. fi
  4157. # Exit here if they wanted silent mode.
  4158. test "$show" = ":" && exit 0
  4159. echo "----------------------------------------------------------------------"
  4160. echo "Libraries have been installed in:"
  4161. for libdir in $libdirs; do
  4162. echo " $libdir"
  4163. done
  4164. echo
  4165. echo "If you ever happen to want to link against installed libraries"
  4166. echo "in a given directory, LIBDIR, you must either use libtool, and"
  4167. echo "specify the full pathname of the library, or use the \`-LLIBDIR'"
  4168. echo "flag during linking and do at least one of the following:"
  4169. if test -n "$shlibpath_var"; then
  4170. echo " - add LIBDIR to the \`$shlibpath_var' environment variable"
  4171. echo " during execution"
  4172. fi
  4173. if test -n "$runpath_var"; then
  4174. echo " - add LIBDIR to the \`$runpath_var' environment variable"
  4175. echo " during linking"
  4176. fi
  4177. if test -n "$hardcode_libdir_flag_spec"; then
  4178. libdir=LIBDIR
  4179. eval flag=\"$hardcode_libdir_flag_spec\"
  4180. echo " - use the \`$flag' linker flag"
  4181. fi
  4182. if test -n "$admincmds"; then
  4183. echo " - have your system administrator run these commands:$admincmds"
  4184. fi
  4185. if test -f /etc/ld.so.conf; then
  4186. echo " - have your system administrator add LIBDIR to \`/etc/ld.so.conf'"
  4187. fi
  4188. echo
  4189. echo "See any operating system documentation about shared libraries for"
  4190. echo "more information, such as the ld(1) and ld.so(8) manual pages."
  4191. echo "----------------------------------------------------------------------"
  4192. exit 0
  4193. ;;
  4194. # libtool execute mode
  4195. execute)
  4196. modename="$modename: execute"
  4197. # The first argument is the command name.
  4198. cmd="$nonopt"
  4199. if test -z "$cmd"; then
  4200. $echo "$modename: you must specify a COMMAND" 1>&2
  4201. $echo "$help"
  4202. exit 1
  4203. fi
  4204. # Handle -dlopen flags immediately.
  4205. for file in $execute_dlfiles; do
  4206. if test ! -f "$file"; then
  4207. $echo "$modename: \`$file' is not a file" 1>&2
  4208. $echo "$help" 1>&2
  4209. exit 1
  4210. fi
  4211. dir=
  4212. case $file in
  4213. *.la)
  4214. # Check to see that this really is a libtool archive.
  4215. if (${SED} -e '2q' $file | egrep "^# Generated by .*$PACKAGE") >/dev/null 2>&1; then :
  4216. else
  4217. $echo "$modename: \`$lib' is not a valid libtool archive" 1>&2
  4218. $echo "$help" 1>&2
  4219. exit 1
  4220. fi
  4221. # Read the libtool library.
  4222. dlname=
  4223. library_names=
  4224. # If there is no directory component, then add one.
  4225. case $file in
  4226. */* | *\\*) . $file ;;
  4227. *) . ./$file ;;
  4228. esac
  4229. # Skip this library if it cannot be dlopened.
  4230. if test -z "$dlname"; then
  4231. # Warn if it was a shared library.
  4232. test -n "$library_names" && $echo "$modename: warning: \`$file' was not linked with \`-export-dynamic'"
  4233. continue
  4234. fi
  4235. dir=`$echo "X$file" | $Xsed -e 's%/[^/]*$%%'`
  4236. test "X$dir" = "X$file" && dir=.
  4237. if test -f "$dir/$objdir/$dlname"; then
  4238. dir="$dir/$objdir"
  4239. else
  4240. $echo "$modename: cannot find \`$dlname' in \`$dir' or \`$dir/$objdir'" 1>&2
  4241. exit 1
  4242. fi
  4243. ;;
  4244. *.lo)
  4245. # Just add the directory containing the .lo file.
  4246. dir=`$echo "X$file" | $Xsed -e 's%/[^/]*$%%'`
  4247. test "X$dir" = "X$file" && dir=.
  4248. ;;
  4249. *)
  4250. $echo "$modename: warning \`-dlopen' is ignored for non-libtool libraries and objects" 1>&2
  4251. continue
  4252. ;;
  4253. esac
  4254. # Get the absolute pathname.
  4255. absdir=`cd "$dir" && pwd`
  4256. test -n "$absdir" && dir="$absdir"
  4257. # Now add the directory to shlibpath_var.
  4258. if eval "test -z \"\$$shlibpath_var\""; then
  4259. eval "$shlibpath_var=\"\$dir\""
  4260. else
  4261. eval "$shlibpath_var=\"\$dir:\$$shlibpath_var\""
  4262. fi
  4263. done
  4264. # This variable tells wrapper scripts just to set shlibpath_var
  4265. # rather than running their programs.
  4266. libtool_execute_magic="$magic"
  4267. # Check if any of the arguments is a wrapper script.
  4268. args=
  4269. for file
  4270. do
  4271. case $file in
  4272. -*) ;;
  4273. *)
  4274. # Do a test to see if this is really a libtool program.
  4275. if (${SED} -e '4q' $file | egrep "^# Generated by .*$PACKAGE") >/dev/null 2>&1; then
  4276. # If there is no directory component, then add one.
  4277. case $file in
  4278. */* | *\\*) . $file ;;
  4279. *) . ./$file ;;
  4280. esac
  4281. # Transform arg to wrapped name.
  4282. file="$progdir/$program"
  4283. fi
  4284. ;;
  4285. esac
  4286. # Quote arguments (to preserve shell metacharacters).
  4287. file=`$echo "X$file" | $Xsed -e "$sed_quote_subst"`
  4288. args="$args \"$file\""
  4289. done
  4290. if test -z "$run"; then
  4291. if test -n "$shlibpath_var"; then
  4292. # Export the shlibpath_var.
  4293. eval "export $shlibpath_var"
  4294. fi
  4295. # Restore saved enviroment variables
  4296. if test "${save_LC_ALL+set}" = set; then
  4297. LC_ALL="$save_LC_ALL"; export LC_ALL
  4298. fi
  4299. if test "${save_LANG+set}" = set; then
  4300. LANG="$save_LANG"; export LANG
  4301. fi
  4302. # Now prepare to actually exec the command.
  4303. exec_cmd="\$cmd$args"
  4304. else
  4305. # Display what would be done.
  4306. if test -n "$shlibpath_var"; then
  4307. eval "\$echo \"\$shlibpath_var=\$$shlibpath_var\""
  4308. $echo "export $shlibpath_var"
  4309. fi
  4310. $echo "$cmd$args"
  4311. exit 0
  4312. fi
  4313. ;;
  4314. # libtool clean and uninstall mode
  4315. clean | uninstall)
  4316. modename="$modename: $mode"
  4317. rm="$nonopt"
  4318. files=
  4319. rmforce=
  4320. exit_status=0
  4321. # This variable tells wrapper scripts just to set variables rather
  4322. # than running their programs.
  4323. libtool_install_magic="$magic"
  4324. for arg
  4325. do
  4326. case $arg in
  4327. -f) rm="$rm $arg"; rmforce=yes ;;
  4328. -*) rm="$rm $arg" ;;
  4329. *) files="$files $arg" ;;
  4330. esac
  4331. done
  4332. if test -z "$rm"; then
  4333. $echo "$modename: you must specify an RM program" 1>&2
  4334. $echo "$help" 1>&2
  4335. exit 1
  4336. fi
  4337. rmdirs=
  4338. for file in $files; do
  4339. dir=`$echo "X$file" | $Xsed -e 's%/[^/]*$%%'`
  4340. if test "X$dir" = "X$file"; then
  4341. dir=.
  4342. objdir="$objdir"
  4343. else
  4344. objdir="$dir/$objdir"
  4345. fi
  4346. name=`$echo "X$file" | $Xsed -e 's%^.*/%%'`
  4347. test $mode = uninstall && objdir="$dir"
  4348. # Remember objdir for removal later, being careful to avoid duplicates
  4349. if test $mode = clean; then
  4350. case " $rmdirs " in
  4351. *" $objdir "*) ;;
  4352. *) rmdirs="$rmdirs $objdir" ;;
  4353. esac
  4354. fi
  4355. # Don't error if the file doesn't exist and rm -f was used.
  4356. if (test -L "$file") >/dev/null 2>&1 \
  4357. || (test -h "$file") >/dev/null 2>&1 \
  4358. || test -f "$file"; then
  4359. :
  4360. elif test -d "$file"; then
  4361. exit_status=1
  4362. continue
  4363. elif test "$rmforce" = yes; then
  4364. continue
  4365. fi
  4366. rmfiles="$file"
  4367. case $name in
  4368. *.la)
  4369. # Possibly a libtool archive, so verify it.
  4370. if (${SED} -e '2q' $file | egrep "^# Generated by .*$PACKAGE") >/dev/null 2>&1; then
  4371. . $dir/$name
  4372. # Delete the libtool libraries and symlinks.
  4373. for n in $library_names; do
  4374. rmfiles="$rmfiles $objdir/$n"
  4375. done
  4376. test -n "$old_library" && rmfiles="$rmfiles $objdir/$old_library"
  4377. test $mode = clean && rmfiles="$rmfiles $objdir/$name $objdir/${name}i"
  4378. if test $mode = uninstall; then
  4379. if test -n "$library_names"; then
  4380. # Do each command in the postuninstall commands.
  4381. eval cmds=\"$postuninstall_cmds\"
  4382. save_ifs="$IFS"; IFS='~'
  4383. for cmd in $cmds; do
  4384. IFS="$save_ifs"
  4385. $show "$cmd"
  4386. $run eval "$cmd"
  4387. if test $? != 0 && test "$rmforce" != yes; then
  4388. exit_status=1
  4389. fi
  4390. done
  4391. IFS="$save_ifs"
  4392. fi
  4393. if test -n "$old_library"; then
  4394. # Do each command in the old_postuninstall commands.
  4395. eval cmds=\"$old_postuninstall_cmds\"
  4396. save_ifs="$IFS"; IFS='~'
  4397. for cmd in $cmds; do
  4398. IFS="$save_ifs"
  4399. $show "$cmd"
  4400. $run eval "$cmd"
  4401. if test $? != 0 && test "$rmforce" != yes; then
  4402. exit_status=1
  4403. fi
  4404. done
  4405. IFS="$save_ifs"
  4406. fi
  4407. # FIXME: should reinstall the best remaining shared library.
  4408. fi
  4409. fi
  4410. ;;
  4411. *.lo)
  4412. if test "$build_old_libs" = yes; then
  4413. oldobj=`$echo "X$name" | $Xsed -e "$lo2o"`
  4414. rmfiles="$rmfiles $dir/$oldobj"
  4415. fi
  4416. ;;
  4417. *)
  4418. # Do a test to see if this is a libtool program.
  4419. if test $mode = clean &&
  4420. (${SED} -e '4q' $file | egrep "^# Generated by .*$PACKAGE") >/dev/null 2>&1; then
  4421. relink_command=
  4422. . $dir/$file
  4423. rmfiles="$rmfiles $objdir/$name $objdir/${name}S.${objext}"
  4424. if test "$fast_install" = yes && test -n "$relink_command"; then
  4425. rmfiles="$rmfiles $objdir/lt-$name"
  4426. fi
  4427. fi
  4428. ;;
  4429. esac
  4430. $show "$rm $rmfiles"
  4431. $run $rm $rmfiles || exit_status=1
  4432. done
  4433. # Try to remove the ${objdir}s in the directories where we deleted files
  4434. for dir in $rmdirs; do
  4435. if test -d "$dir"; then
  4436. $show "rmdir $dir"
  4437. $run rmdir $dir >/dev/null 2>&1
  4438. fi
  4439. done
  4440. exit $exit_status
  4441. ;;
  4442. "")
  4443. $echo "$modename: you must specify a MODE" 1>&2
  4444. $echo "$generic_help" 1>&2
  4445. exit 1
  4446. ;;
  4447. esac
  4448. if test -z "$exec_cmd"; then
  4449. $echo "$modename: invalid operation mode \`$mode'" 1>&2
  4450. $echo "$generic_help" 1>&2
  4451. exit 1
  4452. fi
  4453. fi # test -z "$show_help"
  4454. if test -n "$exec_cmd"; then
  4455. eval exec $exec_cmd
  4456. exit 1
  4457. fi
  4458. # We need to display help for each of the modes.
  4459. case $mode in
  4460. "") $echo \
  4461. "Usage: $modename [OPTION]... [MODE-ARG]...
  4462. Provide generalized library-building support services.
  4463. --config show all configuration variables
  4464. --debug enable verbose shell tracing
  4465. -n, --dry-run display commands without modifying any files
  4466. --features display basic configuration information and exit
  4467. --finish same as \`--mode=finish'
  4468. --help display this help message and exit
  4469. --mode=MODE use operation mode MODE [default=inferred from MODE-ARGS]
  4470. --quiet same as \`--silent'
  4471. --silent don't print informational messages
  4472. --version print version information
  4473. MODE must be one of the following:
  4474. clean remove files from the build directory
  4475. compile compile a source file into a libtool object
  4476. execute automatically set library path, then run a program
  4477. finish complete the installation of libtool libraries
  4478. install install libraries or executables
  4479. link create a library or an executable
  4480. uninstall remove libraries from an installed directory
  4481. MODE-ARGS vary depending on the MODE. Try \`$modename --help --mode=MODE' for
  4482. a more detailed description of MODE."
  4483. exit 0
  4484. ;;
  4485. clean)
  4486. $echo \
  4487. "Usage: $modename [OPTION]... --mode=clean RM [RM-OPTION]... FILE...
  4488. Remove files from the build directory.
  4489. RM is the name of the program to use to delete files associated with each FILE
  4490. (typically \`/bin/rm'). RM-OPTIONS are options (such as \`-f') to be passed
  4491. to RM.
  4492. If FILE is a libtool library, object or program, all the files associated
  4493. with it are deleted. Otherwise, only FILE itself is deleted using RM."
  4494. ;;
  4495. compile)
  4496. $echo \
  4497. "Usage: $modename [OPTION]... --mode=compile COMPILE-COMMAND... SOURCEFILE
  4498. Compile a source file into a libtool library object.
  4499. This mode accepts the following additional options:
  4500. -o OUTPUT-FILE set the output file name to OUTPUT-FILE
  4501. -prefer-pic try to building PIC objects only
  4502. -prefer-non-pic try to building non-PIC objects only
  4503. -static always build a \`.o' file suitable for static linking
  4504. COMPILE-COMMAND is a command to be used in creating a \`standard' object file
  4505. from the given SOURCEFILE.
  4506. The output file name is determined by removing the directory component from
  4507. SOURCEFILE, then substituting the C source code suffix \`.c' with the
  4508. library object suffix, \`.lo'."
  4509. ;;
  4510. execute)
  4511. $echo \
  4512. "Usage: $modename [OPTION]... --mode=execute COMMAND [ARGS]...
  4513. Automatically set library path, then run a program.
  4514. This mode accepts the following additional options:
  4515. -dlopen FILE add the directory containing FILE to the library path
  4516. This mode sets the library path environment variable according to \`-dlopen'
  4517. flags.
  4518. If any of the ARGS are libtool executable wrappers, then they are translated
  4519. into their corresponding uninstalled binary, and any of their required library
  4520. directories are added to the library path.
  4521. Then, COMMAND is executed, with ARGS as arguments."
  4522. ;;
  4523. finish)
  4524. $echo \
  4525. "Usage: $modename [OPTION]... --mode=finish [LIBDIR]...
  4526. Complete the installation of libtool libraries.
  4527. Each LIBDIR is a directory that contains libtool libraries.
  4528. The commands that this mode executes may require superuser privileges. Use
  4529. the \`--dry-run' option if you just want to see what would be executed."
  4530. ;;
  4531. install)
  4532. $echo \
  4533. "Usage: $modename [OPTION]... --mode=install INSTALL-COMMAND...
  4534. Install executables or libraries.
  4535. INSTALL-COMMAND is the installation command. The first component should be
  4536. either the \`install' or \`cp' program.
  4537. The rest of the components are interpreted as arguments to that command (only
  4538. BSD-compatible install options are recognized)."
  4539. ;;
  4540. link)
  4541. $echo \
  4542. "Usage: $modename [OPTION]... --mode=link LINK-COMMAND...
  4543. Link object files or libraries together to form another library, or to
  4544. create an executable program.
  4545. LINK-COMMAND is a command using the C compiler that you would use to create
  4546. a program from several object files.
  4547. The following components of LINK-COMMAND are treated specially:
  4548. -all-static do not do any dynamic linking at all
  4549. -avoid-version do not add a version suffix if possible
  4550. -dlopen FILE \`-dlpreopen' FILE if it cannot be dlopened at runtime
  4551. -dlpreopen FILE link in FILE and add its symbols to lt_preloaded_symbols
  4552. -export-dynamic allow symbols from OUTPUT-FILE to be resolved with dlsym(3)
  4553. -export-symbols SYMFILE
  4554. try to export only the symbols listed in SYMFILE
  4555. -export-symbols-regex REGEX
  4556. try to export only the symbols matching REGEX
  4557. -LLIBDIR search LIBDIR for required installed libraries
  4558. -lNAME OUTPUT-FILE requires the installed library libNAME
  4559. -module build a library that can dlopened
  4560. -no-fast-install disable the fast-install mode
  4561. -no-install link a not-installable executable
  4562. -no-undefined declare that a library does not refer to external symbols
  4563. -o OUTPUT-FILE create OUTPUT-FILE from the specified objects
  4564. -release RELEASE specify package release information
  4565. -rpath LIBDIR the created library will eventually be installed in LIBDIR
  4566. -R[ ]LIBDIR add LIBDIR to the runtime path of programs and libraries
  4567. -static do not do any dynamic linking of libtool libraries
  4568. -version-info CURRENT[:REVISION[:AGE]]
  4569. specify library version info [each variable defaults to 0]
  4570. All other options (arguments beginning with \`-') are ignored.
  4571. Every other argument is treated as a filename. Files ending in \`.la' are
  4572. treated as uninstalled libtool libraries, other files are standard or library
  4573. object files.
  4574. If the OUTPUT-FILE ends in \`.la', then a libtool library is created,
  4575. only library objects (\`.lo' files) may be specified, and \`-rpath' is
  4576. required, except when creating a convenience library.
  4577. If OUTPUT-FILE ends in \`.a' or \`.lib', then a standard library is created
  4578. using \`ar' and \`ranlib', or on Windows using \`lib'.
  4579. If OUTPUT-FILE ends in \`.lo' or \`.${objext}', then a reloadable object file
  4580. is created, otherwise an executable program is created."
  4581. ;;
  4582. uninstall)
  4583. $echo \
  4584. "Usage: $modename [OPTION]... --mode=uninstall RM [RM-OPTION]... FILE...
  4585. Remove libraries from an installation directory.
  4586. RM is the name of the program to use to delete files associated with each FILE
  4587. (typically \`/bin/rm'). RM-OPTIONS are options (such as \`-f') to be passed
  4588. to RM.
  4589. If FILE is a libtool library, all the files associated with it are deleted.
  4590. Otherwise, only FILE itself is deleted using RM."
  4591. ;;
  4592. *)
  4593. $echo "$modename: invalid operation mode \`$mode'" 1>&2
  4594. $echo "$help" 1>&2
  4595. exit 1
  4596. ;;
  4597. esac
  4598. echo
  4599. $echo "Try \`$modename --help' for more information about other modes."
  4600. exit 0
  4601. # Local Variables:
  4602. # mode:shell-script
  4603. # sh-indentation:2
  4604. # End: