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.

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