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.

4946 lines
135 KiB

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