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.

4012 lines
108 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
  1. # ltmain.sh - Provide generalized library-building support services.
  2. # NOTE: Changing this file will not affect anything until you rerun ltconfig.
  3. #
  4. # Copyright (C) 1996-1999 Free Software Foundation, Inc.
  5. # Originally by Gordon Matzigkeit <gord@gnu.ai.mit.edu>, 1996
  6. #
  7. # This program is free software; you can redistribute it and/or modify
  8. # it under the terms of the GNU General Public License as published by
  9. # the Free Software Foundation; either version 2 of the License, or
  10. # (at your option) any later version.
  11. #
  12. # This program is distributed in the hope that it will be useful, but
  13. # WITHOUT ANY WARRANTY; without even the implied warranty of
  14. # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
  15. # General Public License for more details.
  16. #
  17. # You should have received a copy of the GNU General Public License
  18. # along with this program; if not, write to the Free Software
  19. # Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
  20. #
  21. # As a special exception to the GNU General Public License, if you
  22. # distribute this file as part of a program that contains a
  23. # configuration script generated by Autoconf, you may include it under
  24. # the same distribution terms that you use for the rest of that program.
  25. # Check that we have a working $echo.
  26. if test "X$1" = X--no-reexec; then
  27. # Discard the --no-reexec flag, and continue.
  28. shift
  29. elif test "X$1" = X--fallback-echo; then
  30. # Avoid inline document here, it may be left over
  31. :
  32. elif test "X`($echo '\t') 2>/dev/null`" = 'X\t'; then
  33. # Yippee, $echo works!
  34. :
  35. else
  36. # Restart under the correct shell, and then maybe $echo will work.
  37. exec $SHELL "$0" --no-reexec ${1+"$@"}
  38. fi
  39. if test "X$1" = X--fallback-echo; then
  40. # used as fallback echo
  41. shift
  42. cat <<EOF
  43. $*
  44. EOF
  45. exit 0
  46. fi
  47. # The name of this program.
  48. progname=`$echo "$0" | sed 's%^.*/%%'`
  49. modename="$progname"
  50. # Constants.
  51. PROGRAM=ltmain.sh
  52. PACKAGE=libtool
  53. VERSION=1.3.4
  54. TIMESTAMP=" (1.385.2.196 1999/12/07 21:47:57)"
  55. default_mode=
  56. help="Try \`$progname --help' for more information."
  57. magic="%%%MAGIC variable%%%"
  58. mkdir="mkdir"
  59. mv="mv -f"
  60. rm="rm -f"
  61. # Sed substitution that helps us do robust quoting. It backslashifies
  62. # metacharacters that are still active within double-quoted strings.
  63. Xsed='sed -e 1s/^X//'
  64. sed_quote_subst='s/\([\\`\\"$\\\\]\)/\\\1/g'
  65. SP2NL='tr \040 \012'
  66. NL2SP='tr \015\012 \040\040'
  67. # NLS nuisances.
  68. # Only set LANG and LC_ALL to C if already set.
  69. # These must not be set unconditionally because not all systems understand
  70. # e.g. LANG=C (notably SCO).
  71. # We save the old values to restore during execute mode.
  72. if test "${LC_ALL+set}" = set; then
  73. save_LC_ALL="$LC_ALL"; LC_ALL=C; export LC_ALL
  74. fi
  75. if test "${LANG+set}" = set; then
  76. save_LANG="$LANG"; LANG=C; export LANG
  77. fi
  78. if test "$LTCONFIG_VERSION" != "$VERSION"; then
  79. echo "$modename: ltconfig version \`$LTCONFIG_VERSION' does not match $PROGRAM version \`$VERSION'" 1>&2
  80. echo "Fatal configuration error. See the $PACKAGE docs for more information." 1>&2
  81. exit 1
  82. fi
  83. if test "$build_libtool_libs" != yes && test "$build_old_libs" != yes; then
  84. echo "$modename: not configured to build any kind of library" 1>&2
  85. echo "Fatal configuration error. See the $PACKAGE docs for more information." 1>&2
  86. exit 1
  87. fi
  88. # Global variables.
  89. mode=$default_mode
  90. nonopt=
  91. prev=
  92. prevopt=
  93. run=
  94. show="$echo"
  95. show_help=
  96. execute_dlfiles=
  97. lo2o="s/\\.lo\$/.${objext}/"
  98. o2lo="s/\\.${objext}\$/.lo/"
  99. # Parse our command line options once, thoroughly.
  100. while test $# -gt 0
  101. do
  102. arg="$1"
  103. shift
  104. case "$arg" in
  105. -*=*) optarg=`$echo "X$arg" | $Xsed -e 's/[-_a-zA-Z0-9]*=//'` ;;
  106. *) optarg= ;;
  107. esac
  108. # If the previous option needs an argument, assign it.
  109. if test -n "$prev"; then
  110. case "$prev" in
  111. execute_dlfiles)
  112. eval "$prev=\"\$$prev \$arg\""
  113. ;;
  114. *)
  115. eval "$prev=\$arg"
  116. ;;
  117. esac
  118. prev=
  119. prevopt=
  120. continue
  121. fi
  122. # Have we seen a non-optional argument yet?
  123. case "$arg" in
  124. --help)
  125. show_help=yes
  126. ;;
  127. --version)
  128. echo "$PROGRAM (GNU $PACKAGE) $VERSION$TIMESTAMP"
  129. exit 0
  130. ;;
  131. --config)
  132. sed -e '1,/^### BEGIN LIBTOOL CONFIG/d' -e '/^### END LIBTOOL CONFIG/,$d' $0
  133. exit 0
  134. ;;
  135. --debug)
  136. echo "$progname: enabling shell trace mode"
  137. set -x
  138. ;;
  139. --dry-run | -n)
  140. run=:
  141. ;;
  142. --features)
  143. echo "host: $host"
  144. if test "$build_libtool_libs" = yes; then
  145. echo "enable shared libraries"
  146. else
  147. echo "disable shared libraries"
  148. fi
  149. if test "$build_old_libs" = yes; then
  150. echo "enable static libraries"
  151. else
  152. echo "disable static libraries"
  153. fi
  154. exit 0
  155. ;;
  156. --finish) mode="finish" ;;
  157. --mode) prevopt="--mode" prev=mode ;;
  158. --mode=*) mode="$optarg" ;;
  159. --quiet | --silent)
  160. show=:
  161. ;;
  162. -dlopen)
  163. prevopt="-dlopen"
  164. prev=execute_dlfiles
  165. ;;
  166. -*)
  167. $echo "$modename: unrecognized option \`$arg'" 1>&2
  168. $echo "$help" 1>&2
  169. exit 1
  170. ;;
  171. *)
  172. nonopt="$arg"
  173. break
  174. ;;
  175. esac
  176. done
  177. if test -n "$prevopt"; then
  178. $echo "$modename: option \`$prevopt' requires an argument" 1>&2
  179. $echo "$help" 1>&2
  180. exit 1
  181. fi
  182. if test -z "$show_help"; then
  183. # Infer the operation mode.
  184. if test -z "$mode"; then
  185. case "$nonopt" in
  186. *cc | *++ | gcc* | *-gcc*)
  187. mode=link
  188. for arg
  189. do
  190. case "$arg" in
  191. -c)
  192. mode=compile
  193. break
  194. ;;
  195. esac
  196. done
  197. ;;
  198. *db | *dbx | *strace | *truss)
  199. mode=execute
  200. ;;
  201. *install*|cp|mv)
  202. mode=install
  203. ;;
  204. *rm)
  205. mode=uninstall
  206. ;;
  207. *)
  208. # If we have no mode, but dlfiles were specified, then do execute mode.
  209. test -n "$execute_dlfiles" && mode=execute
  210. # Just use the default operation mode.
  211. if test -z "$mode"; then
  212. if test -n "$nonopt"; then
  213. $echo "$modename: warning: cannot infer operation mode from \`$nonopt'" 1>&2
  214. else
  215. $echo "$modename: warning: cannot infer operation mode without MODE-ARGS" 1>&2
  216. fi
  217. fi
  218. ;;
  219. esac
  220. fi
  221. # Only execute mode is allowed to have -dlopen flags.
  222. if test -n "$execute_dlfiles" && test "$mode" != execute; then
  223. $echo "$modename: unrecognized option \`-dlopen'" 1>&2
  224. $echo "$help" 1>&2
  225. exit 1
  226. fi
  227. # Change the help message to a mode-specific one.
  228. generic_help="$help"
  229. help="Try \`$modename --help --mode=$mode' for more information."
  230. # These modes are in order of execution frequency so that they run quickly.
  231. case "$mode" in
  232. # libtool compile mode
  233. compile)
  234. modename="$modename: compile"
  235. # Get the compilation command and the source file.
  236. base_compile=
  237. lastarg=
  238. srcfile="$nonopt"
  239. suppress_output=
  240. user_target=no
  241. for arg
  242. do
  243. # Accept any command-line options.
  244. case "$arg" in
  245. -o)
  246. if test "$user_target" != "no"; then
  247. $echo "$modename: you cannot specify \`-o' more than once" 1>&2
  248. exit 1
  249. fi
  250. user_target=next
  251. ;;
  252. -static)
  253. build_old_libs=yes
  254. continue
  255. ;;
  256. esac
  257. case "$user_target" in
  258. next)
  259. # The next one is the -o target name
  260. user_target=yes
  261. continue
  262. ;;
  263. yes)
  264. # We got the output file
  265. user_target=set
  266. libobj="$arg"
  267. continue
  268. ;;
  269. esac
  270. # Accept the current argument as the source file.
  271. lastarg="$srcfile"
  272. srcfile="$arg"
  273. # Aesthetically quote the previous argument.
  274. # Backslashify any backslashes, double quotes, and dollar signs.
  275. # These are the only characters that are still specially
  276. # interpreted inside of double-quoted scrings.
  277. lastarg=`$echo "X$lastarg" | $Xsed -e "$sed_quote_subst"`
  278. # Double-quote args containing other shell metacharacters.
  279. # Many Bourne shells cannot handle close brackets correctly in scan
  280. # sets, so we specify it separately.
  281. case "$lastarg" in
  282. *[\[\~\#\^\&\*\(\)\{\}\|\;\<\>\?\'\ \ ]*|*]*)
  283. lastarg="\"$lastarg\""
  284. ;;
  285. esac
  286. # Add the previous argument to base_compile.
  287. if test -z "$base_compile"; then
  288. base_compile="$lastarg"
  289. else
  290. base_compile="$base_compile $lastarg"
  291. fi
  292. done
  293. case "$user_target" in
  294. set)
  295. ;;
  296. no)
  297. # Get the name of the library object.
  298. libobj=`$echo "X$srcfile" | $Xsed -e 's%^.*/%%'`
  299. ;;
  300. *)
  301. $echo "$modename: you must specify a target with \`-o'" 1>&2
  302. exit 1
  303. ;;
  304. esac
  305. # Recognize several different file suffixes.
  306. # If the user specifies -o file.o, it is replaced with file.lo
  307. xform='[cCFSfmso]'
  308. case "$libobj" in
  309. *.ada) xform=ada ;;
  310. *.adb) xform=adb ;;
  311. *.ads) xform=ads ;;
  312. *.asm) xform=asm ;;
  313. *.c++) xform=c++ ;;
  314. *.cc) xform=cc ;;
  315. *.cpp) xform=cpp ;;
  316. *.cxx) xform=cxx ;;
  317. *.f90) xform=f90 ;;
  318. *.for) xform=for ;;
  319. esac
  320. libobj=`$echo "X$libobj" | $Xsed -e "s/\.$xform$/.lo/"`
  321. case "$libobj" in
  322. *.lo) obj=`$echo "X$libobj" | $Xsed -e "$lo2o"` ;;
  323. *)
  324. $echo "$modename: cannot determine name of library object from \`$libobj'" 1>&2
  325. exit 1
  326. ;;
  327. esac
  328. if test -z "$base_compile"; then
  329. $echo "$modename: you must specify a compilation command" 1>&2
  330. $echo "$help" 1>&2
  331. exit 1
  332. fi
  333. # Delete any leftover library objects.
  334. if test "$build_old_libs" = yes; then
  335. removelist="$obj $libobj"
  336. else
  337. removelist="$libobj"
  338. fi
  339. $run $rm $removelist
  340. trap "$run $rm $removelist; exit 1" 1 2 15
  341. # Calculate the filename of the output object if compiler does
  342. # not support -o with -c
  343. if test "$compiler_c_o" = no; then
  344. output_obj=`$echo "X$srcfile" | $Xsed -e 's%^.*/%%' -e 's%\..*$%%'`.${objext}
  345. lockfile="$output_obj.lock"
  346. removelist="$removelist $output_obj $lockfile"
  347. trap "$run $rm $removelist; exit 1" 1 2 15
  348. else
  349. need_locks=no
  350. lockfile=
  351. fi
  352. # Lock this critical section if it is needed
  353. # We use this script file to make the link, it avoids creating a new file
  354. if test "$need_locks" = yes; then
  355. until ln "$0" "$lockfile" 2>/dev/null; do
  356. $show "Waiting for $lockfile to be removed"
  357. sleep 2
  358. done
  359. elif test "$need_locks" = warn; then
  360. if test -f "$lockfile"; then
  361. echo "\
  362. *** ERROR, $lockfile exists and contains:
  363. `cat $lockfile 2>/dev/null`
  364. This indicates that another process is trying to use the same
  365. temporary object file, and libtool could not work around it because
  366. your compiler does not support \`-c' and \`-o' together. If you
  367. repeat this compilation, it may succeed, by chance, but you had better
  368. avoid parallel builds (make -j) in this platform, or get a better
  369. compiler."
  370. $run $rm $removelist
  371. exit 1
  372. fi
  373. echo $srcfile > "$lockfile"
  374. fi
  375. if test -n "$fix_srcfile_path"; then
  376. eval srcfile=\"$fix_srcfile_path\"
  377. fi
  378. # Only build a PIC object if we are building libtool libraries.
  379. if test "$build_libtool_libs" = yes; then
  380. # Without this assignment, base_compile gets emptied.
  381. fbsd_hideous_sh_bug=$base_compile
  382. # All platforms use -DPIC, to notify preprocessed assembler code.
  383. command="$base_compile $srcfile $pic_flag -DPIC"
  384. if test "$build_old_libs" = yes; then
  385. lo_libobj="$libobj"
  386. dir=`$echo "X$libobj" | $Xsed -e 's%/[^/]*$%%'`
  387. if test "X$dir" = "X$libobj"; then
  388. dir="$objdir"
  389. else
  390. dir="$dir/$objdir"
  391. fi
  392. libobj="$dir/"`$echo "X$libobj" | $Xsed -e 's%^.*/%%'`
  393. if test -d "$dir"; then
  394. $show "$rm $libobj"
  395. $run $rm $libobj
  396. else
  397. $show "$mkdir $dir"
  398. $run $mkdir $dir
  399. status=$?
  400. if test $status -ne 0 && test ! -d $dir; then
  401. exit $status
  402. fi
  403. fi
  404. fi
  405. if test "$compiler_o_lo" = yes; then
  406. output_obj="$libobj"
  407. command="$command -o $output_obj"
  408. elif test "$compiler_c_o" = yes; then
  409. output_obj="$obj"
  410. command="$command -o $output_obj"
  411. fi
  412. $run $rm "$output_obj"
  413. $show "$command"
  414. if $run eval "$command"; then :
  415. else
  416. test -n "$output_obj" && $run $rm $removelist
  417. exit 1
  418. fi
  419. if test "$need_locks" = warn &&
  420. test x"`cat $lockfile 2>/dev/null`" != x"$srcfile"; then
  421. echo "\
  422. *** ERROR, $lockfile contains:
  423. `cat $lockfile 2>/dev/null`
  424. but it should contain:
  425. $srcfile
  426. This indicates that another process is trying to use the same
  427. temporary object file, and libtool could not work around it because
  428. your compiler does not support \`-c' and \`-o' together. If you
  429. repeat this compilation, it may succeed, by chance, but you had better
  430. avoid parallel builds (make -j) in this platform, or get a better
  431. compiler."
  432. $run $rm $removelist
  433. exit 1
  434. fi
  435. # Just move the object if needed, then go on to compile the next one
  436. if test x"$output_obj" != x"$libobj"; then
  437. $show "$mv $output_obj $libobj"
  438. if $run $mv $output_obj $libobj; then :
  439. else
  440. error=$?
  441. $run $rm $removelist
  442. exit $error
  443. fi
  444. fi
  445. # If we have no pic_flag, then copy the object into place and finish.
  446. if test -z "$pic_flag" && test "$build_old_libs" = yes; then
  447. # Rename the .lo from within objdir to obj
  448. if test -f $obj; then
  449. $show $rm $obj
  450. $run $rm $obj
  451. fi
  452. $show "$mv $libobj $obj"
  453. if $run $mv $libobj $obj; then :
  454. else
  455. error=$?
  456. $run $rm $removelist
  457. exit $error
  458. fi
  459. xdir=`$echo "X$obj" | $Xsed -e 's%/[^/]*$%%'`
  460. if test "X$xdir" = "X$obj"; then
  461. xdir="."
  462. else
  463. xdir="$xdir"
  464. fi
  465. baseobj=`$echo "X$obj" | $Xsed -e "s%.*/%%"`
  466. libobj=`$echo "X$baseobj" | $Xsed -e "$o2lo"`
  467. # Now arrange that obj and lo_libobj become the same file
  468. $show "(cd $xdir && $LN_S $baseobj $libobj)"
  469. if $run eval '(cd $xdir && $LN_S $baseobj $libobj)'; then
  470. exit 0
  471. else
  472. error=$?
  473. $run $rm $removelist
  474. exit $error
  475. fi
  476. fi
  477. # Allow error messages only from the first compilation.
  478. suppress_output=' >/dev/null 2>&1'
  479. fi
  480. # Only build a position-dependent object if we build old libraries.
  481. if test "$build_old_libs" = yes; then
  482. command="$base_compile $srcfile"
  483. if test "$compiler_c_o" = yes; then
  484. command="$command -o $obj"
  485. output_obj="$obj"
  486. fi
  487. # Suppress compiler output if we already did a PIC compilation.
  488. command="$command$suppress_output"
  489. $run $rm "$output_obj"
  490. $show "$command"
  491. if $run eval "$command"; then :
  492. else
  493. $run $rm $removelist
  494. exit 1
  495. fi
  496. if test "$need_locks" = warn &&
  497. test x"`cat $lockfile 2>/dev/null`" != x"$srcfile"; then
  498. echo "\
  499. *** ERROR, $lockfile contains:
  500. `cat $lockfile 2>/dev/null`
  501. but it should contain:
  502. $srcfile
  503. This indicates that another process is trying to use the same
  504. temporary object file, and libtool could not work around it because
  505. your compiler does not support \`-c' and \`-o' together. If you
  506. repeat this compilation, it may succeed, by chance, but you had better
  507. avoid parallel builds (make -j) in this platform, or get a better
  508. compiler."
  509. $run $rm $removelist
  510. exit 1
  511. fi
  512. # Just move the object if needed
  513. if test x"$output_obj" != x"$obj"; then
  514. $show "$mv $output_obj $obj"
  515. if $run $mv $output_obj $obj; then :
  516. else
  517. error=$?
  518. $run $rm $removelist
  519. exit $error
  520. fi
  521. fi
  522. # Create an invalid libtool object if no PIC, so that we do not
  523. # accidentally link it into a program.
  524. if test "$build_libtool_libs" != yes; then
  525. $show "echo timestamp > $libobj"
  526. $run eval "echo timestamp > \$libobj" || exit $?
  527. else
  528. # Move the .lo from within objdir
  529. $show "$mv $libobj $lo_libobj"
  530. if $run $mv $libobj $lo_libobj; then :
  531. else
  532. error=$?
  533. $run $rm $removelist
  534. exit $error
  535. fi
  536. fi
  537. fi
  538. # Unlock the critical section if it was locked
  539. if test "$need_locks" != no; then
  540. $rm "$lockfile"
  541. fi
  542. exit 0
  543. ;;
  544. # libtool link mode
  545. link)
  546. modename="$modename: link"
  547. case "$host" in
  548. *-*-cygwin* | *-*-mingw* | *-*-os2*)
  549. # It is impossible to link a dll without this setting, and
  550. # we shouldn't force the makefile maintainer to figure out
  551. # which system we are compiling for in order to pass an extra
  552. # flag for every libtool invokation.
  553. # allow_undefined=no
  554. # FIXME: Unfortunately, there are problems with the above when trying
  555. # to make a dll which has undefined symbols, in which case not
  556. # even a static library is built. For now, we need to specify
  557. # -no-undefined on the libtool link line when we can be certain
  558. # that all symbols are satisfied, otherwise we get a static library.
  559. allow_undefined=yes
  560. # This is a source program that is used to create dlls on Windows
  561. # Don't remove nor modify the starting and closing comments
  562. # /* ltdll.c starts here */
  563. # #define WIN32_LEAN_AND_MEAN
  564. # #include <windows.h>
  565. # #undef WIN32_LEAN_AND_MEAN
  566. # #include <stdio.h>
  567. #
  568. # #ifndef __CYGWIN__
  569. # # ifdef __CYGWIN32__
  570. # # define __CYGWIN__ __CYGWIN32__
  571. # # endif
  572. # #endif
  573. #
  574. # #ifdef __cplusplus
  575. # extern "C" {
  576. # #endif
  577. # BOOL APIENTRY DllMain (HINSTANCE hInst, DWORD reason, LPVOID reserved);
  578. # #ifdef __cplusplus
  579. # }
  580. # #endif
  581. #
  582. # #ifdef __CYGWIN__
  583. # #include <cygwin/cygwin_dll.h>
  584. # DECLARE_CYGWIN_DLL( DllMain );
  585. # #endif
  586. # HINSTANCE __hDllInstance_base;
  587. #
  588. # BOOL APIENTRY
  589. # DllMain (HINSTANCE hInst, DWORD reason, LPVOID reserved)
  590. # {
  591. # __hDllInstance_base = hInst;
  592. # return TRUE;
  593. # }
  594. # /* ltdll.c ends here */
  595. # This is a source program that is used to create import libraries
  596. # on Windows for dlls which lack them. Don't remove nor modify the
  597. # starting and closing comments
  598. # /* impgen.c starts here */
  599. # /* Copyright (C) 1999 Free Software Foundation, Inc.
  600. #
  601. # This file is part of GNU libtool.
  602. #
  603. # This program is free software; you can redistribute it and/or modify
  604. # it under the terms of the GNU General Public License as published by
  605. # the Free Software Foundation; either version 2 of the License, or
  606. # (at your option) any later version.
  607. #
  608. # This program is distributed in the hope that it will be useful,
  609. # but WITHOUT ANY WARRANTY; without even the implied warranty of
  610. # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
  611. # GNU General Public License for more details.
  612. #
  613. # You should have received a copy of the GNU General Public License
  614. # along with this program; if not, write to the Free Software
  615. # Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
  616. # */
  617. #
  618. # #include <stdio.h> /* for printf() */
  619. # #include <unistd.h> /* for open(), lseek(), read() */
  620. # #include <fcntl.h> /* for O_RDONLY, O_BINARY */
  621. # #include <string.h> /* for strdup() */
  622. #
  623. # static unsigned int
  624. # pe_get16 (fd, offset)
  625. # int fd;
  626. # int offset;
  627. # {
  628. # unsigned char b[2];
  629. # lseek (fd, offset, SEEK_SET);
  630. # read (fd, b, 2);
  631. # return b[0] + (b[1]<<8);
  632. # }
  633. #
  634. # static unsigned int
  635. # pe_get32 (fd, offset)
  636. # int fd;
  637. # int offset;
  638. # {
  639. # unsigned char b[4];
  640. # lseek (fd, offset, SEEK_SET);
  641. # read (fd, b, 4);
  642. # return b[0] + (b[1]<<8) + (b[2]<<16) + (b[3]<<24);
  643. # }
  644. #
  645. # static unsigned int
  646. # pe_as32 (ptr)
  647. # void *ptr;
  648. # {
  649. # unsigned char *b = ptr;
  650. # return b[0] + (b[1]<<8) + (b[2]<<16) + (b[3]<<24);
  651. # }
  652. #
  653. # int
  654. # main (argc, argv)
  655. # int argc;
  656. # char *argv[];
  657. # {
  658. # int dll;
  659. # unsigned long pe_header_offset, opthdr_ofs, num_entries, i;
  660. # unsigned long export_rva, export_size, nsections, secptr, expptr;
  661. # unsigned long name_rvas, nexp;
  662. # unsigned char *expdata, *erva;
  663. # char *filename, *dll_name;
  664. #
  665. # filename = argv[1];
  666. #
  667. # dll = open(filename, O_RDONLY|O_BINARY);
  668. # if (!dll)
  669. # return 1;
  670. #
  671. # dll_name = filename;
  672. #
  673. # for (i=0; filename[i]; i++)
  674. # if (filename[i] == '/' || filename[i] == '\\' || filename[i] == ':')
  675. # dll_name = filename + i +1;
  676. #
  677. # pe_header_offset = pe_get32 (dll, 0x3c);
  678. # opthdr_ofs = pe_header_offset + 4 + 20;
  679. # num_entries = pe_get32 (dll, opthdr_ofs + 92);
  680. #
  681. # if (num_entries < 1) /* no exports */
  682. # return 1;
  683. #
  684. # export_rva = pe_get32 (dll, opthdr_ofs + 96);
  685. # export_size = pe_get32 (dll, opthdr_ofs + 100);
  686. # nsections = pe_get16 (dll, pe_header_offset + 4 +2);
  687. # secptr = (pe_header_offset + 4 + 20 +
  688. # pe_get16 (dll, pe_header_offset + 4 + 16));
  689. #
  690. # expptr = 0;
  691. # for (i = 0; i < nsections; i++)
  692. # {
  693. # char sname[8];
  694. # unsigned long secptr1 = secptr + 40 * i;
  695. # unsigned long vaddr = pe_get32 (dll, secptr1 + 12);
  696. # unsigned long vsize = pe_get32 (dll, secptr1 + 16);
  697. # unsigned long fptr = pe_get32 (dll, secptr1 + 20);
  698. # lseek(dll, secptr1, SEEK_SET);
  699. # read(dll, sname, 8);
  700. # if (vaddr <= export_rva && vaddr+vsize > export_rva)
  701. # {
  702. # expptr = fptr + (export_rva - vaddr);
  703. # if (export_rva + export_size > vaddr + vsize)
  704. # export_size = vsize - (export_rva - vaddr);
  705. # break;
  706. # }
  707. # }
  708. #
  709. # expdata = (unsigned char*)malloc(export_size);
  710. # lseek (dll, expptr, SEEK_SET);
  711. # read (dll, expdata, export_size);
  712. # erva = expdata - export_rva;
  713. #
  714. # nexp = pe_as32 (expdata+24);
  715. # name_rvas = pe_as32 (expdata+32);
  716. #
  717. # printf ("EXPORTS\n");
  718. # for (i = 0; i<nexp; i++)
  719. # {
  720. # unsigned long name_rva = pe_as32 (erva+name_rvas+i*4);
  721. # printf ("\t%s @ %ld ;\n", erva+name_rva, 1+ i);
  722. # }
  723. #
  724. # return 0;
  725. # }
  726. # /* impgen.c ends here */
  727. ;;
  728. *)
  729. allow_undefined=yes
  730. ;;
  731. esac
  732. compile_command="$nonopt"
  733. finalize_command="$nonopt"
  734. compile_rpath=
  735. finalize_rpath=
  736. compile_shlibpath=
  737. finalize_shlibpath=
  738. convenience=
  739. old_convenience=
  740. deplibs=
  741. linkopts=
  742. if test -n "$shlibpath_var"; then
  743. # get the directories listed in $shlibpath_var
  744. eval lib_search_path=\`\$echo \"X \${$shlibpath_var}\" \| \$Xsed -e \'s/:/ /g\'\`
  745. else
  746. lib_search_path=
  747. fi
  748. # now prepend the system-specific ones
  749. eval lib_search_path=\"$sys_lib_search_path_spec\$lib_search_path\"
  750. eval sys_lib_dlsearch_path=\"$sys_lib_dlsearch_path_spec\"
  751. avoid_version=no
  752. dlfiles=
  753. dlprefiles=
  754. dlself=no
  755. export_dynamic=no
  756. export_symbols=
  757. export_symbols_regex=
  758. generated=
  759. libobjs=
  760. link_against_libtool_libs=
  761. ltlibs=
  762. module=no
  763. objs=
  764. prefer_static_libs=no
  765. preload=no
  766. prev=
  767. prevarg=
  768. release=
  769. rpath=
  770. xrpath=
  771. perm_rpath=
  772. temp_rpath=
  773. thread_safe=no
  774. vinfo=
  775. # We need to know -static, to get the right output filenames.
  776. for arg
  777. do
  778. case "$arg" in
  779. -all-static | -static)
  780. if test "X$arg" = "X-all-static"; then
  781. if test "$build_libtool_libs" = yes && test -z "$link_static_flag"; then
  782. $echo "$modename: warning: complete static linking is impossible in this configuration" 1>&2
  783. fi
  784. if test -n "$link_static_flag"; then
  785. dlopen_self=$dlopen_self_static
  786. fi
  787. else
  788. if test -z "$pic_flag" && test -n "$link_static_flag"; then
  789. dlopen_self=$dlopen_self_static
  790. fi
  791. fi
  792. build_libtool_libs=no
  793. build_old_libs=yes
  794. prefer_static_libs=yes
  795. break
  796. ;;
  797. esac
  798. done
  799. # See if our shared archives depend on static archives.
  800. test -n "$old_archive_from_new_cmds" && build_old_libs=yes
  801. # Go through the arguments, transforming them on the way.
  802. while test $# -gt 0; do
  803. arg="$1"
  804. shift
  805. # If the previous option needs an argument, assign it.
  806. if test -n "$prev"; then
  807. case "$prev" in
  808. output)
  809. compile_command="$compile_command @OUTPUT@"
  810. finalize_command="$finalize_command @OUTPUT@"
  811. ;;
  812. esac
  813. case "$prev" in
  814. dlfiles|dlprefiles)
  815. if test "$preload" = no; then
  816. # Add the symbol object into the linking commands.
  817. compile_command="$compile_command @SYMFILE@"
  818. finalize_command="$finalize_command @SYMFILE@"
  819. preload=yes
  820. fi
  821. case "$arg" in
  822. *.la | *.lo) ;; # We handle these cases below.
  823. force)
  824. if test "$dlself" = no; then
  825. dlself=needless
  826. export_dynamic=yes
  827. fi
  828. prev=
  829. continue
  830. ;;
  831. self)
  832. if test "$prev" = dlprefiles; then
  833. dlself=yes
  834. elif test "$prev" = dlfiles && test "$dlopen_self" != yes; then
  835. dlself=yes
  836. else
  837. dlself=needless
  838. export_dynamic=yes
  839. fi
  840. prev=
  841. continue
  842. ;;
  843. *)
  844. if test "$prev" = dlfiles; then
  845. dlfiles="$dlfiles $arg"
  846. else
  847. dlprefiles="$dlprefiles $arg"
  848. fi
  849. prev=
  850. ;;
  851. esac
  852. ;;
  853. expsyms)
  854. export_symbols="$arg"
  855. if test ! -f "$arg"; then
  856. $echo "$modename: symbol file \`$arg' does not exist"
  857. exit 1
  858. fi
  859. prev=
  860. continue
  861. ;;
  862. expsyms_regex)
  863. export_symbols_regex="$arg"
  864. prev=
  865. continue
  866. ;;
  867. release)
  868. release="-$arg"
  869. prev=
  870. continue
  871. ;;
  872. rpath | xrpath)
  873. # We need an absolute path.
  874. case "$arg" in
  875. [\\/]* | [A-Za-z]:[\\/]*) ;;
  876. *)
  877. $echo "$modename: only absolute run-paths are allowed" 1>&2
  878. exit 1
  879. ;;
  880. esac
  881. if test "$prev" = rpath; then
  882. case "$rpath " in
  883. *" $arg "*) ;;
  884. *) rpath="$rpath $arg" ;;
  885. esac
  886. else
  887. case "$xrpath " in
  888. *" $arg "*) ;;
  889. *) xrpath="$xrpath $arg" ;;
  890. esac
  891. fi
  892. prev=
  893. continue
  894. ;;
  895. *)
  896. eval "$prev=\"\$arg\""
  897. prev=
  898. continue
  899. ;;
  900. esac
  901. fi
  902. prevarg="$arg"
  903. case "$arg" in
  904. -all-static)
  905. if test -n "$link_static_flag"; then
  906. compile_command="$compile_command $link_static_flag"
  907. finalize_command="$finalize_command $link_static_flag"
  908. fi
  909. continue
  910. ;;
  911. -allow-undefined)
  912. # FIXME: remove this flag sometime in the future.
  913. $echo "$modename: \`-allow-undefined' is deprecated because it is the default" 1>&2
  914. continue
  915. ;;
  916. -avoid-version)
  917. avoid_version=yes
  918. continue
  919. ;;
  920. -dlopen)
  921. prev=dlfiles
  922. continue
  923. ;;
  924. -dlpreopen)
  925. prev=dlprefiles
  926. continue
  927. ;;
  928. -export-dynamic)
  929. export_dynamic=yes
  930. continue
  931. ;;
  932. -export-symbols | -export-symbols-regex)
  933. if test -n "$export_symbols" || test -n "$export_symbols_regex"; then
  934. $echo "$modename: not more than one -exported-symbols argument allowed"
  935. exit 1
  936. fi
  937. if test "X$arg" = "X-export-symbols"; then
  938. prev=expsyms
  939. else
  940. prev=expsyms_regex
  941. fi
  942. continue
  943. ;;
  944. -L*)
  945. dir=`$echo "X$arg" | $Xsed -e 's/^-L//'`
  946. # We need an absolute path.
  947. case "$dir" in
  948. [\\/]* | [A-Za-z]:[\\/]*) ;;
  949. *)
  950. absdir=`cd "$dir" && pwd`
  951. if test -z "$absdir"; then
  952. $echo "$modename: warning: cannot determine absolute directory name of \`$dir'" 1>&2
  953. $echo "$modename: passing it literally to the linker, although it might fail" 1>&2
  954. absdir="$dir"
  955. fi
  956. dir="$absdir"
  957. ;;
  958. esac
  959. case " $deplibs " in
  960. *" $arg "*) ;;
  961. *) deplibs="$deplibs $arg";;
  962. esac
  963. case " $lib_search_path " in
  964. *" $dir "*) ;;
  965. *) lib_search_path="$lib_search_path $dir";;
  966. esac
  967. case "$host" in
  968. *-*-cygwin* | *-*-mingw* | *-*-os2*)
  969. dllsearchdir=`cd "$dir" && pwd || echo "$dir"`
  970. case ":$dllsearchpath:" in
  971. ::) dllsearchpath="$dllsearchdir";;
  972. *":$dllsearchdir:"*) ;;
  973. *) dllsearchpath="$dllsearchpath:$dllsearchdir";;
  974. esac
  975. ;;
  976. esac
  977. ;;
  978. -l*)
  979. if test "$arg" = "-lc"; then
  980. case "$host" in
  981. *-*-cygwin* | *-*-mingw* | *-*-os2* | *-*-beos*)
  982. # These systems don't actually have c library (as such)
  983. continue
  984. ;;
  985. esac
  986. elif test "$arg" = "-lm"; then
  987. case "$host" in
  988. *-*-cygwin* | *-*-beos*)
  989. # These systems don't actually have math library (as such)
  990. continue
  991. ;;
  992. esac
  993. fi
  994. deplibs="$deplibs $arg"
  995. ;;
  996. -module)
  997. module=yes
  998. continue
  999. ;;
  1000. -no-undefined)
  1001. allow_undefined=no
  1002. continue
  1003. ;;
  1004. -o) prev=output ;;
  1005. -release)
  1006. prev=release
  1007. continue
  1008. ;;
  1009. -rpath)
  1010. prev=rpath
  1011. continue
  1012. ;;
  1013. -R)
  1014. prev=xrpath
  1015. continue
  1016. ;;
  1017. -R*)
  1018. dir=`$echo "X$arg" | $Xsed -e 's/^-R//'`
  1019. # We need an absolute path.
  1020. case "$dir" in
  1021. [\\/]* | [A-Za-z]:[\\/]*) ;;
  1022. *)
  1023. $echo "$modename: only absolute run-paths are allowed" 1>&2
  1024. exit 1
  1025. ;;
  1026. esac
  1027. case "$xrpath " in
  1028. *" $dir "*) ;;
  1029. *) xrpath="$xrpath $dir" ;;
  1030. esac
  1031. continue
  1032. ;;
  1033. -static)
  1034. # If we have no pic_flag, then this is the same as -all-static.
  1035. if test -z "$pic_flag" && test -n "$link_static_flag"; then
  1036. compile_command="$compile_command $link_static_flag"
  1037. finalize_command="$finalize_command $link_static_flag"
  1038. fi
  1039. continue
  1040. ;;
  1041. -thread-safe)
  1042. thread_safe=yes
  1043. continue
  1044. ;;
  1045. -version-info)
  1046. prev=vinfo
  1047. continue
  1048. ;;
  1049. # Some other compiler flag.
  1050. -* | +*)
  1051. # Unknown arguments in both finalize_command and compile_command need
  1052. # to be aesthetically quoted because they are evaled later.
  1053. arg=`$echo "X$arg" | $Xsed -e "$sed_quote_subst"`
  1054. case "$arg" in
  1055. *[\[\~\#\^\&\*\(\)\{\}\|\;\<\>\?\'\ \ ]*|*]*)
  1056. arg="\"$arg\""
  1057. ;;
  1058. esac
  1059. ;;
  1060. *.o | *.obj | *.a | *.lib)
  1061. # A standard object.
  1062. objs="$objs $arg"
  1063. ;;
  1064. *.lo)
  1065. # A library object.
  1066. if test "$prev" = dlfiles; then
  1067. dlfiles="$dlfiles $arg"
  1068. if test "$build_libtool_libs" = yes && test "$dlopen" = yes; then
  1069. prev=
  1070. continue
  1071. else
  1072. # If libtool objects are unsupported, then we need to preload.
  1073. prev=dlprefiles
  1074. fi
  1075. fi
  1076. if test "$prev" = dlprefiles; then
  1077. # Preload the old-style object.
  1078. dlprefiles="$dlprefiles "`$echo "X$arg" | $Xsed -e "$lo2o"`
  1079. prev=
  1080. fi
  1081. libobjs="$libobjs $arg"
  1082. ;;
  1083. *.la)
  1084. # A libtool-controlled library.
  1085. dlname=
  1086. libdir=
  1087. library_names=
  1088. old_library=
  1089. # Check to see that this really is a libtool archive.
  1090. if (sed -e '2q' $arg | egrep "^# Generated by .*$PACKAGE") >/dev/null 2>&1; then :
  1091. else
  1092. $echo "$modename: \`$arg' is not a valid libtool archive" 1>&2
  1093. exit 1
  1094. fi
  1095. # If the library was installed with an old release of libtool,
  1096. # it will not redefine variable installed.
  1097. installed=yes
  1098. # Read the .la file
  1099. # If there is no directory component, then add one.
  1100. case "$arg" in
  1101. */* | *\\*) . $arg ;;
  1102. *) . ./$arg ;;
  1103. esac
  1104. # Get the name of the library we link against.
  1105. linklib=
  1106. for l in $old_library $library_names; do
  1107. linklib="$l"
  1108. done
  1109. if test -z "$linklib"; then
  1110. $echo "$modename: cannot find name of link library for \`$arg'" 1>&2
  1111. exit 1
  1112. fi
  1113. # Find the relevant object directory and library name.
  1114. name=`$echo "X$arg" | $Xsed -e 's%^.*/%%' -e 's/\.la$//' -e 's/^lib//'`
  1115. if test "X$installed" = Xyes; then
  1116. dir="$libdir"
  1117. else
  1118. dir=`$echo "X$arg" | $Xsed -e 's%/[^/]*$%%'`
  1119. if test "X$dir" = "X$arg"; then
  1120. dir="$objdir"
  1121. else
  1122. dir="$dir/$objdir"
  1123. fi
  1124. fi
  1125. if test -n "$dependency_libs"; then
  1126. # Extract -R and -L from dependency_libs
  1127. temp_deplibs=
  1128. for deplib in $dependency_libs; do
  1129. case "$deplib" in
  1130. -R*) temp_xrpath=`$echo "X$deplib" | $Xsed -e 's/^-R//'`
  1131. case " $rpath $xrpath " in
  1132. *" $temp_xrpath "*) ;;
  1133. *) xrpath="$xrpath $temp_xrpath";;
  1134. esac;;
  1135. -L*) case "$compile_command $temp_deplibs " in
  1136. *" $deplib "*) ;;
  1137. *) temp_deplibs="$temp_deplibs $deplib";;
  1138. esac
  1139. temp_dir=`$echo "X$deplib" | $Xsed -e 's/^-L//'`
  1140. case " $lib_search_path " in
  1141. *" $temp_dir "*) ;;
  1142. *) lib_search_path="$lib_search_path $temp_dir";;
  1143. esac
  1144. ;;
  1145. *) temp_deplibs="$temp_deplibs $deplib";;
  1146. esac
  1147. done
  1148. dependency_libs="$temp_deplibs"
  1149. fi
  1150. if test -z "$libdir"; then
  1151. # It is a libtool convenience library, so add in its objects.
  1152. convenience="$convenience $dir/$old_library"
  1153. old_convenience="$old_convenience $dir/$old_library"
  1154. deplibs="$deplibs$dependency_libs"
  1155. compile_command="$compile_command $dir/$old_library$dependency_libs"
  1156. finalize_command="$finalize_command $dir/$old_library$dependency_libs"
  1157. continue
  1158. fi
  1159. # This library was specified with -dlopen.
  1160. if test "$prev" = dlfiles; then
  1161. dlfiles="$dlfiles $arg"
  1162. if test -z "$dlname" || test "$dlopen" != yes || test "$build_libtool_libs" = no; then
  1163. # If there is no dlname, no dlopen support or we're linking statically,
  1164. # we need to preload.
  1165. prev=dlprefiles
  1166. else
  1167. # We should not create a dependency on this library, but we
  1168. # may need any libraries it requires.
  1169. compile_command="$compile_command$dependency_libs"
  1170. finalize_command="$finalize_command$dependency_libs"
  1171. prev=
  1172. continue
  1173. fi
  1174. fi
  1175. # The library was specified with -dlpreopen.
  1176. if test "$prev" = dlprefiles; then
  1177. # Prefer using a static library (so that no silly _DYNAMIC symbols
  1178. # are required to link).
  1179. if test -n "$old_library"; then
  1180. dlprefiles="$dlprefiles $dir/$old_library"
  1181. else
  1182. dlprefiles="$dlprefiles $dir/$linklib"
  1183. fi
  1184. prev=
  1185. fi
  1186. if test -n "$library_names" &&
  1187. { test "$prefer_static_libs" = no || test -z "$old_library"; }; then
  1188. link_against_libtool_libs="$link_against_libtool_libs $arg"
  1189. if test -n "$shlibpath_var"; then
  1190. # Make sure the rpath contains only unique directories.
  1191. case "$temp_rpath " in
  1192. *" $dir "*) ;;
  1193. *) temp_rpath="$temp_rpath $dir" ;;
  1194. esac
  1195. fi
  1196. # We need an absolute path.
  1197. case "$dir" in
  1198. [\\/] | [A-Za-z]:[\\/]*) absdir="$dir" ;;
  1199. *)
  1200. absdir=`cd "$dir" && pwd`
  1201. if test -z "$absdir"; then
  1202. $echo "$modename: warning: cannot determine absolute directory name of \`$dir'" 1>&2
  1203. $echo "$modename: passing it literally to the linker, although it might fail" 1>&2
  1204. absdir="$dir"
  1205. fi
  1206. ;;
  1207. esac
  1208. # This is the magic to use -rpath.
  1209. # Skip directories that are in the system default run-time
  1210. # search path, unless they have been requested with -R.
  1211. case " $sys_lib_dlsearch_path " in
  1212. *" $absdir "*) ;;
  1213. *)
  1214. case "$compile_rpath " in
  1215. *" $absdir "*) ;;
  1216. *) compile_rpath="$compile_rpath $absdir"
  1217. esac
  1218. ;;
  1219. esac
  1220. case " $sys_lib_dlsearch_path " in
  1221. *" $libdir "*) ;;
  1222. *)
  1223. case "$finalize_rpath " in
  1224. *" $libdir "*) ;;
  1225. *) finalize_rpath="$finalize_rpath $libdir"
  1226. esac
  1227. ;;
  1228. esac
  1229. lib_linked=yes
  1230. case "$hardcode_action" in
  1231. immediate | unsupported)
  1232. if test "$hardcode_direct" = no; then
  1233. compile_command="$compile_command $dir/$linklib"
  1234. deplibs="$deplibs $dir/$linklib"
  1235. case "$host" in
  1236. *-*-cygwin* | *-*-mingw* | *-*-os2*)
  1237. dllsearchdir=`cd "$dir" && pwd || echo "$dir"`
  1238. if test -n "$dllsearchpath"; then
  1239. dllsearchpath="$dllsearchpath:$dllsearchdir"
  1240. else
  1241. dllsearchpath="$dllsearchdir"
  1242. fi
  1243. ;;
  1244. esac
  1245. elif test "$hardcode_minus_L" = no; then
  1246. case "$host" in
  1247. *-*-sunos*)
  1248. compile_shlibpath="$compile_shlibpath$dir:"
  1249. ;;
  1250. esac
  1251. case "$compile_command " in
  1252. *" -L$dir "*) ;;
  1253. *) compile_command="$compile_command -L$dir";;
  1254. esac
  1255. compile_command="$compile_command -l$name"
  1256. deplibs="$deplibs -L$dir -l$name"
  1257. elif test "$hardcode_shlibpath_var" = no; then
  1258. case ":$compile_shlibpath:" in
  1259. *":$dir:"*) ;;
  1260. *) compile_shlibpath="$compile_shlibpath$dir:";;
  1261. esac
  1262. compile_command="$compile_command -l$name"
  1263. deplibs="$deplibs -l$name"
  1264. else
  1265. lib_linked=no
  1266. fi
  1267. ;;
  1268. relink)
  1269. if test "$hardcode_direct" = yes; then
  1270. compile_command="$compile_command $absdir/$linklib"
  1271. deplibs="$deplibs $absdir/$linklib"
  1272. elif test "$hardcode_minus_L" = yes; then
  1273. case "$compile_command " in
  1274. *" -L$absdir "*) ;;
  1275. *) compile_command="$compile_command -L$absdir";;
  1276. esac
  1277. compile_command="$compile_command -l$name"
  1278. deplibs="$deplibs -L$absdir -l$name"
  1279. elif test "$hardcode_shlibpath_var" = yes; then
  1280. case ":$compile_shlibpath:" in
  1281. *":$absdir:"*) ;;
  1282. *) compile_shlibpath="$compile_shlibpath$absdir:";;
  1283. esac
  1284. compile_command="$compile_command -l$name"
  1285. deplibs="$deplibs -l$name"
  1286. else
  1287. lib_linked=no
  1288. fi
  1289. ;;
  1290. *)
  1291. lib_linked=no
  1292. ;;
  1293. esac
  1294. if test "$lib_linked" != yes; then
  1295. $echo "$modename: configuration error: unsupported hardcode properties"
  1296. exit 1
  1297. fi
  1298. # Finalize command for both is simple: just hardcode it.
  1299. if test "$hardcode_direct" = yes; then
  1300. finalize_command="$finalize_command $libdir/$linklib"
  1301. elif test "$hardcode_minus_L" = yes; then
  1302. case "$finalize_command " in
  1303. *" -L$libdir "*) ;;
  1304. *) finalize_command="$finalize_command -L$libdir";;
  1305. esac
  1306. finalize_command="$finalize_command -l$name"
  1307. elif test "$hardcode_shlibpath_var" = yes; then
  1308. case ":$finalize_shlibpath:" in
  1309. *":$libdir:"*) ;;
  1310. *) finalize_shlibpath="$finalize_shlibpath$libdir:";;
  1311. esac
  1312. finalize_command="$finalize_command -l$name"
  1313. else
  1314. # We cannot seem to hardcode it, guess we'll fake it.
  1315. case "$finalize_command " in
  1316. *" -L$dir "*) ;;
  1317. *) finalize_command="$finalize_command -L$libdir";;
  1318. esac
  1319. finalize_command="$finalize_command -l$name"
  1320. fi
  1321. else
  1322. # Transform directly to old archives if we don't build new libraries.
  1323. if test -n "$pic_flag" && test -z "$old_library"; then
  1324. $echo "$modename: cannot find static library for \`$arg'" 1>&2
  1325. exit 1
  1326. fi
  1327. # Here we assume that one of hardcode_direct or hardcode_minus_L
  1328. # is not unsupported. This is valid on all known static and
  1329. # shared platforms.
  1330. if test "$hardcode_direct" != unsupported; then
  1331. test -n "$old_library" && linklib="$old_library"
  1332. compile_command="$compile_command $dir/$linklib"
  1333. finalize_command="$finalize_command $dir/$linklib"
  1334. else
  1335. case "$compile_command " in
  1336. *" -L$dir "*) ;;
  1337. *) compile_command="$compile_command -L$dir";;
  1338. esac
  1339. compile_command="$compile_command -l$name"
  1340. case "$finalize_command " in
  1341. *" -L$dir "*) ;;
  1342. *) finalize_command="$finalize_command -L$dir";;
  1343. esac
  1344. finalize_command="$finalize_command -l$name"
  1345. fi
  1346. fi
  1347. # Add in any libraries that this one depends upon.
  1348. compile_command="$compile_command$dependency_libs"
  1349. finalize_command="$finalize_command$dependency_libs"
  1350. continue
  1351. ;;
  1352. # Some other compiler argument.
  1353. *)
  1354. # Unknown arguments in both finalize_command and compile_command need
  1355. # to be aesthetically quoted because they are evaled later.
  1356. arg=`$echo "X$arg" | $Xsed -e "$sed_quote_subst"`
  1357. case "$arg" in
  1358. *[\[\~\#\^\&\*\(\)\{\}\|\;\<\>\?\'\ \ ]*|*]*)
  1359. arg="\"$arg\""
  1360. ;;
  1361. esac
  1362. ;;
  1363. esac
  1364. # Now actually substitute the argument into the commands.
  1365. if test -n "$arg"; then
  1366. compile_command="$compile_command $arg"
  1367. finalize_command="$finalize_command $arg"
  1368. fi
  1369. done
  1370. if test -n "$prev"; then
  1371. $echo "$modename: the \`$prevarg' option requires an argument" 1>&2
  1372. $echo "$help" 1>&2
  1373. exit 1
  1374. fi
  1375. if test "$export_dynamic" = yes && test -n "$export_dynamic_flag_spec"; then
  1376. eval arg=\"$export_dynamic_flag_spec\"
  1377. compile_command="$compile_command $arg"
  1378. finalize_command="$finalize_command $arg"
  1379. fi
  1380. oldlibs=
  1381. # calculate the name of the file, without its directory
  1382. outputname=`$echo "X$output" | $Xsed -e 's%^.*/%%'`
  1383. libobjs_save="$libobjs"
  1384. case "$output" in
  1385. "")
  1386. $echo "$modename: you must specify an output file" 1>&2
  1387. $echo "$help" 1>&2
  1388. exit 1
  1389. ;;
  1390. *.a | *.lib)
  1391. if test -n "$link_against_libtool_libs"; then
  1392. $echo "$modename: error: cannot link libtool libraries into archives" 1>&2
  1393. exit 1
  1394. fi
  1395. if test -n "$deplibs"; then
  1396. $echo "$modename: warning: \`-l' and \`-L' are ignored for archives" 1>&2
  1397. fi
  1398. if test -n "$dlfiles$dlprefiles" || test "$dlself" != no; then
  1399. $echo "$modename: warning: \`-dlopen' is ignored for archives" 1>&2
  1400. fi
  1401. if test -n "$rpath"; then
  1402. $echo "$modename: warning: \`-rpath' is ignored for archives" 1>&2
  1403. fi
  1404. if test -n "$xrpath"; then
  1405. $echo "$modename: warning: \`-R' is ignored for archives" 1>&2
  1406. fi
  1407. if test -n "$vinfo"; then
  1408. $echo "$modename: warning: \`-version-info' is ignored for archives" 1>&2
  1409. fi
  1410. if test -n "$release"; then
  1411. $echo "$modename: warning: \`-release' is ignored for archives" 1>&2
  1412. fi
  1413. if test -n "$export_symbols" || test -n "$export_symbols_regex"; then
  1414. $echo "$modename: warning: \`-export-symbols' is ignored for archives" 1>&2
  1415. fi
  1416. # Now set the variables for building old libraries.
  1417. build_libtool_libs=no
  1418. oldlibs="$output"
  1419. ;;
  1420. *.la)
  1421. # Make sure we only generate libraries of the form `libNAME.la'.
  1422. case "$outputname" in
  1423. lib*)
  1424. name=`$echo "X$outputname" | $Xsed -e 's/\.la$//' -e 's/^lib//'`
  1425. eval libname=\"$libname_spec\"
  1426. ;;
  1427. *)
  1428. if test "$module" = no; then
  1429. $echo "$modename: libtool library \`$output' must begin with \`lib'" 1>&2
  1430. $echo "$help" 1>&2
  1431. exit 1
  1432. fi
  1433. if test "$need_lib_prefix" != no; then
  1434. # Add the "lib" prefix for modules if required
  1435. name=`$echo "X$outputname" | $Xsed -e 's/\.la$//'`
  1436. eval libname=\"$libname_spec\"
  1437. else
  1438. libname=`$echo "X$outputname" | $Xsed -e 's/\.la$//'`
  1439. fi
  1440. ;;
  1441. esac
  1442. output_objdir=`$echo "X$output" | $Xsed -e 's%/[^/]*$%%'`
  1443. if test "X$output_objdir" = "X$output"; then
  1444. output_objdir="$objdir"
  1445. else
  1446. output_objdir="$output_objdir/$objdir"
  1447. fi
  1448. if test -n "$objs"; then
  1449. $echo "$modename: cannot build libtool library \`$output' from non-libtool objects:$objs" 2>&1
  1450. exit 1
  1451. fi
  1452. # How the heck are we supposed to write a wrapper for a shared library?
  1453. if test -n "$link_against_libtool_libs"; then
  1454. $echo "$modename: error: cannot link shared libraries into libtool libraries" 1>&2
  1455. exit 1
  1456. fi
  1457. if test -n "$dlfiles$dlprefiles" || test "$dlself" != no; then
  1458. $echo "$modename: warning: \`-dlopen' is ignored for libtool libraries" 1>&2
  1459. fi
  1460. set dummy $rpath
  1461. if test $# -gt 2; then
  1462. $echo "$modename: warning: ignoring multiple \`-rpath's for a libtool library" 1>&2
  1463. fi
  1464. install_libdir="$2"
  1465. oldlibs=
  1466. if test -z "$rpath"; then
  1467. if test "$build_libtool_libs" = yes; then
  1468. # Building a libtool convenience library.
  1469. libext=al
  1470. oldlibs="$output_objdir/$libname.$libext $oldlibs"
  1471. build_libtool_libs=convenience
  1472. build_old_libs=yes
  1473. fi
  1474. dependency_libs="$deplibs"
  1475. if test -n "$vinfo"; then
  1476. $echo "$modename: warning: \`-version-info' is ignored for convenience libraries" 1>&2
  1477. fi
  1478. if test -n "$release"; then
  1479. $echo "$modename: warning: \`-release' is ignored for convenience libraries" 1>&2
  1480. fi
  1481. else
  1482. # Parse the version information argument.
  1483. IFS="${IFS= }"; save_ifs="$IFS"; IFS=':'
  1484. set dummy $vinfo 0 0 0
  1485. IFS="$save_ifs"
  1486. if test -n "$8"; then
  1487. $echo "$modename: too many parameters to \`-version-info'" 1>&2
  1488. $echo "$help" 1>&2
  1489. exit 1
  1490. fi
  1491. current="$2"
  1492. revision="$3"
  1493. age="$4"
  1494. # Check that each of the things are valid numbers.
  1495. case "$current" in
  1496. 0 | [1-9] | [1-9][0-9]*) ;;
  1497. *)
  1498. $echo "$modename: CURRENT \`$current' is not a nonnegative integer" 1>&2
  1499. $echo "$modename: \`$vinfo' is not valid version information" 1>&2
  1500. exit 1
  1501. ;;
  1502. esac
  1503. case "$revision" in
  1504. 0 | [1-9] | [1-9][0-9]*) ;;
  1505. *)
  1506. $echo "$modename: REVISION \`$revision' is not a nonnegative integer" 1>&2
  1507. $echo "$modename: \`$vinfo' is not valid version information" 1>&2
  1508. exit 1
  1509. ;;
  1510. esac
  1511. case "$age" in
  1512. 0 | [1-9] | [1-9][0-9]*) ;;
  1513. *)
  1514. $echo "$modename: AGE \`$age' is not a nonnegative integer" 1>&2
  1515. $echo "$modename: \`$vinfo' is not valid version information" 1>&2
  1516. exit 1
  1517. ;;
  1518. esac
  1519. if test $age -gt $current; then
  1520. $echo "$modename: AGE \`$age' is greater than the current interface number \`$current'" 1>&2
  1521. $echo "$modename: \`$vinfo' is not valid version information" 1>&2
  1522. exit 1
  1523. fi
  1524. # Calculate the version variables.
  1525. major=
  1526. versuffix=
  1527. verstring=
  1528. case "$version_type" in
  1529. none) ;;
  1530. irix)
  1531. major=`expr $current - $age + 1`
  1532. versuffix="$major.$revision"
  1533. verstring="sgi$major.$revision"
  1534. # Add in all the interfaces that we are compatible with.
  1535. loop=$revision
  1536. while test $loop != 0; do
  1537. iface=`expr $revision - $loop`
  1538. loop=`expr $loop - 1`
  1539. verstring="sgi$major.$iface:$verstring"
  1540. done
  1541. ;;
  1542. linux)
  1543. major=.`expr $current - $age`
  1544. versuffix="$major.$age.$revision"
  1545. ;;
  1546. osf)
  1547. major=`expr $current - $age`
  1548. versuffix=".$current.$age.$revision"
  1549. verstring="$current.$age.$revision"
  1550. # Add in all the interfaces that we are compatible with.
  1551. loop=$age
  1552. while test $loop != 0; do
  1553. iface=`expr $current - $loop`
  1554. loop=`expr $loop - 1`
  1555. verstring="$verstring:${iface}.0"
  1556. done
  1557. # Make executables depend on our current version.
  1558. verstring="$verstring:${current}.0"
  1559. ;;
  1560. sunos)
  1561. major=".$current"
  1562. versuffix=".$current.$revision"
  1563. ;;
  1564. freebsd-aout)
  1565. major=".$current"
  1566. versuffix=".$current.$revision";
  1567. ;;
  1568. freebsd-elf)
  1569. major=".$current"
  1570. versuffix=".$current";
  1571. ;;
  1572. windows)
  1573. # Like Linux, but with '-' rather than '.', since we only
  1574. # want one extension on Windows 95.
  1575. major=`expr $current - $age`
  1576. versuffix="-$major-$age-$revision"
  1577. ;;
  1578. *)
  1579. $echo "$modename: unknown library version type \`$version_type'" 1>&2
  1580. echo "Fatal configuration error. See the $PACKAGE docs for more information." 1>&2
  1581. exit 1
  1582. ;;
  1583. esac
  1584. # Clear the version info if we defaulted, and they specified a release.
  1585. if test -z "$vinfo" && test -n "$release"; then
  1586. major=
  1587. verstring="0.0"
  1588. if test "$need_version" = no; then
  1589. versuffix=
  1590. else
  1591. versuffix=".0.0"
  1592. fi
  1593. fi
  1594. # Remove version info from name if versioning should be avoided
  1595. if test "$avoid_version" = yes && test "$need_version" = no; then
  1596. major=
  1597. versuffix=
  1598. verstring=""
  1599. fi
  1600. # Check to see if the archive will have undefined symbols.
  1601. if test "$allow_undefined" = yes; then
  1602. if test "$allow_undefined_flag" = unsupported; then
  1603. $echo "$modename: warning: undefined symbols not allowed in $host shared libraries" 1>&2
  1604. build_libtool_libs=no
  1605. build_old_libs=yes
  1606. fi
  1607. else
  1608. # Don't allow undefined symbols.
  1609. allow_undefined_flag="$no_undefined_flag"
  1610. fi
  1611. dependency_libs="$deplibs"
  1612. case "$host" in
  1613. *-*-cygwin* | *-*-mingw* | *-*-os2* | *-*-beos*)
  1614. # these systems don't actually have a c library (as such)!
  1615. ;;
  1616. *)
  1617. # Add libc to deplibs on all other systems.
  1618. deplibs="$deplibs -lc"
  1619. ;;
  1620. esac
  1621. fi
  1622. # Create the output directory, or remove our outputs if we need to.
  1623. if test -d $output_objdir; then
  1624. $show "${rm}r $output_objdir/$outputname $output_objdir/$libname.* $output_objdir/${libname}${release}.*"
  1625. $run ${rm}r $output_objdir/$outputname $output_objdir/$libname.* $output_objdir/${libname}${release}.*
  1626. else
  1627. $show "$mkdir $output_objdir"
  1628. $run $mkdir $output_objdir
  1629. status=$?
  1630. if test $status -ne 0 && test ! -d $output_objdir; then
  1631. exit $status
  1632. fi
  1633. fi
  1634. # Now set the variables for building old libraries.
  1635. if test "$build_old_libs" = yes && test "$build_libtool_libs" != convenience ; then
  1636. oldlibs="$oldlibs $output_objdir/$libname.$libext"
  1637. # Transform .lo files to .o files.
  1638. oldobjs="$objs "`$echo "X$libobjs" | $SP2NL | $Xsed -e '/\.'${libext}'$/d' -e "$lo2o" | $NL2SP`
  1639. fi
  1640. if test "$build_libtool_libs" = yes; then
  1641. # Transform deplibs into only deplibs that can be linked in shared.
  1642. name_save=$name
  1643. libname_save=$libname
  1644. release_save=$release
  1645. versuffix_save=$versuffix
  1646. major_save=$major
  1647. # I'm not sure if I'm treating the release correctly. I think
  1648. # release should show up in the -l (ie -lgmp5) so we don't want to
  1649. # add it in twice. Is that correct?
  1650. release=""
  1651. versuffix=""
  1652. major=""
  1653. newdeplibs=
  1654. droppeddeps=no
  1655. case "$deplibs_check_method" in
  1656. pass_all)
  1657. # Don't check for shared/static. Everything works.
  1658. # This might be a little naive. We might want to check
  1659. # whether the library exists or not. But this is on
  1660. # osf3 & osf4 and I'm not really sure... Just
  1661. # implementing what was already the behaviour.
  1662. newdeplibs=$deplibs
  1663. ;;
  1664. test_compile)
  1665. # This code stresses the "libraries are programs" paradigm to its
  1666. # limits. Maybe even breaks it. We compile a program, linking it
  1667. # against the deplibs as a proxy for the library. Then we can check
  1668. # whether they linked in statically or dynamically with ldd.
  1669. $rm conftest.c
  1670. cat > conftest.c <<EOF
  1671. int main() { return 0; }
  1672. EOF
  1673. $rm conftest
  1674. $CC -o conftest conftest.c $deplibs
  1675. if test $? -eq 0 ; then
  1676. ldd_output=`ldd conftest`
  1677. for i in $deplibs; do
  1678. name="`expr $i : '-l\(.*\)'`"
  1679. # If $name is empty we are operating on a -L argument.
  1680. if test "$name" != "" ; then
  1681. libname=`eval \\$echo \"$libname_spec\"`
  1682. deplib_matches=`eval \\$echo \"$library_names_spec\"`
  1683. set dummy $deplib_matches
  1684. deplib_match=$2
  1685. if test `expr "$ldd_output" : ".*$deplib_match"` -ne 0 ; then
  1686. newdeplibs="$newdeplibs $i"
  1687. else
  1688. droppeddeps=yes
  1689. echo
  1690. echo "*** Warning: This library needs some functionality provided by $i."
  1691. echo "*** I have the capability to make that library automatically link in when"
  1692. echo "*** you link to this library. But I can only do this if you have a"
  1693. echo "*** shared version of the library, which you do not appear to have."
  1694. fi
  1695. else
  1696. newdeplibs="$newdeplibs $i"
  1697. fi
  1698. done
  1699. else
  1700. # Error occured in the first compile. Let's try to salvage the situation:
  1701. # Compile a seperate program for each library.
  1702. for i in $deplibs; do
  1703. name="`expr $i : '-l\(.*\)'`"
  1704. # If $name is empty we are operating on a -L argument.
  1705. if test "$name" != "" ; then
  1706. $rm conftest
  1707. $CC -o conftest conftest.c $i
  1708. # Did it work?
  1709. if test $? -eq 0 ; then
  1710. ldd_output=`ldd conftest`
  1711. libname=`eval \\$echo \"$libname_spec\"`
  1712. deplib_matches=`eval \\$echo \"$library_names_spec\"`
  1713. set dummy $deplib_matches
  1714. deplib_match=$2
  1715. if test `expr "$ldd_output" : ".*$deplib_match"` -ne 0 ; then
  1716. newdeplibs="$newdeplibs $i"
  1717. else
  1718. droppeddeps=yes
  1719. echo
  1720. echo "*** Warning: This library needs some functionality provided by $i."
  1721. echo "*** I have the capability to make that library automatically link in when"
  1722. echo "*** you link to this library. But I can only do this if you have a"
  1723. echo "*** shared version of the library, which you do not appear to have."
  1724. fi
  1725. else
  1726. droppeddeps=yes
  1727. echo
  1728. echo "*** Warning! Library $i is needed by this library but I was not able to"
  1729. echo "*** make it link in! You will probably need to install it or some"
  1730. echo "*** library that it depends on before this library will be fully"
  1731. echo "*** functional. Installing it before continuing would be even better."
  1732. fi
  1733. else
  1734. newdeplibs="$newdeplibs $i"
  1735. fi
  1736. done
  1737. fi
  1738. ;;
  1739. file_magic*)
  1740. set dummy $deplibs_check_method
  1741. file_magic_regex="`expr \"$deplibs_check_method\" : \"$2 \(.*\)\"`"
  1742. for a_deplib in $deplibs; do
  1743. name="`expr $a_deplib : '-l\(.*\)'`"
  1744. # If $name is empty we are operating on a -L argument.
  1745. if test "$name" != "" ; then
  1746. libname=`eval \\$echo \"$libname_spec\"`
  1747. for i in $lib_search_path; do
  1748. potential_libs=`ls $i/$libname[.-]* 2>/dev/null`
  1749. for potent_lib in $potential_libs; do
  1750. # Follow soft links.
  1751. if ls -lLd "$potent_lib" 2>/dev/null \
  1752. | grep " -> " >/dev/null; then
  1753. continue
  1754. fi
  1755. # The statement above tries to avoid entering an
  1756. # endless loop below, in case of cyclic links.
  1757. # We might still enter an endless loop, since a link
  1758. # loop can be closed while we follow links,
  1759. # but so what?
  1760. potlib="$potent_lib"
  1761. while test -h "$potlib" 2>/dev/null; do
  1762. potliblink=`ls -ld $potlib | sed 's/.* -> //'`
  1763. case "$potliblink" in
  1764. [\\/]* | [A-Za-z]:[\\/]*) potlib="$potliblink";;
  1765. *) potlib=`$echo "X$potlib" | $Xsed -e 's,[^/]*$,,'`"$potliblink";;
  1766. esac
  1767. done
  1768. if eval $file_magic_cmd \"\$potlib\" 2>/dev/null \
  1769. | sed 10q \
  1770. | egrep "$file_magic_regex" > /dev/null; then
  1771. newdeplibs="$newdeplibs $a_deplib"
  1772. a_deplib=""
  1773. break 2
  1774. fi
  1775. done
  1776. done
  1777. if test -n "$a_deplib" ; then
  1778. droppeddeps=yes
  1779. echo
  1780. echo "*** Warning: This library needs some functionality provided by $a_deplib."
  1781. echo "*** I have the capability to make that library automatically link in when"
  1782. echo "*** you link to this library. But I can only do this if you have a"
  1783. echo "*** shared version of the library, which you do not appear to have."
  1784. fi
  1785. else
  1786. # Add a -L argument.
  1787. newdeplibs="$newdeplibs $a_deplib"
  1788. fi
  1789. done # Gone through all deplibs.
  1790. ;;
  1791. none | unknown | *)
  1792. newdeplibs=""
  1793. if $echo "X $deplibs" | $Xsed -e 's/ -lc$//' \
  1794. -e 's/ -[LR][^ ]*//g' -e 's/[ ]//g' |
  1795. grep . >/dev/null; then
  1796. echo
  1797. if test "X$deplibs_check_method" = "Xnone"; then
  1798. echo "*** Warning: inter-library dependencies are not supported in this platform."
  1799. else
  1800. echo "*** Warning: inter-library dependencies are not known to be supported."
  1801. fi
  1802. echo "*** All declared inter-library dependencies are being dropped."
  1803. droppeddeps=yes
  1804. fi
  1805. ;;
  1806. esac
  1807. versuffix=$versuffix_save
  1808. major=$major_save
  1809. release=$release_save
  1810. libname=$libname_save
  1811. name=$name_save
  1812. if test "$droppeddeps" = yes; then
  1813. if test "$module" = yes; then
  1814. echo
  1815. echo "*** Warning: libtool could not satisfy all declared inter-library"
  1816. echo "*** dependencies of module $libname. Therefore, libtool will create"
  1817. echo "*** a static module, that should work as long as the dlopening"
  1818. echo "*** application is linked with the -dlopen flag."
  1819. if test -z "$global_symbol_pipe"; then
  1820. echo
  1821. echo "*** However, this would only work if libtool was able to extract symbol"
  1822. echo "*** lists from a program, using \`nm' or equivalent, but libtool could"
  1823. echo "*** not find such a program. So, this module is probably useless."
  1824. echo "*** \`nm' from GNU binutils and a full rebuild may help."
  1825. fi
  1826. if test "$build_old_libs" = no; then
  1827. oldlibs="$output_objdir/$libname.$libext"
  1828. build_libtool_libs=module
  1829. build_old_libs=yes
  1830. else
  1831. build_libtool_libs=no
  1832. fi
  1833. else
  1834. echo "*** The inter-library dependencies that have been dropped here will be"
  1835. echo "*** automatically added whenever a program is linked with this library"
  1836. echo "*** or is declared to -dlopen it."
  1837. fi
  1838. fi
  1839. # Done checking deplibs!
  1840. deplibs=$newdeplibs
  1841. fi
  1842. # All the library-specific variables (install_libdir is set above).
  1843. library_names=
  1844. old_library=
  1845. dlname=
  1846. # Test again, we may have decided not to build it any more
  1847. if test "$build_libtool_libs" = yes; then
  1848. # Get the real and link names of the library.
  1849. eval library_names=\"$library_names_spec\"
  1850. set dummy $library_names
  1851. realname="$2"
  1852. shift; shift
  1853. if test -n "$soname_spec"; then
  1854. eval soname=\"$soname_spec\"
  1855. else
  1856. soname="$realname"
  1857. fi
  1858. lib="$output_objdir/$realname"
  1859. for link
  1860. do
  1861. linknames="$linknames $link"
  1862. done
  1863. # Ensure that we have .o objects for linkers which dislike .lo
  1864. # (e.g. aix) in case we are running --disable-static
  1865. for obj in $libobjs; do
  1866. xdir=`$echo "X$obj" | $Xsed -e 's%/[^/]*$%%'`
  1867. if test "X$xdir" = "X$obj"; then
  1868. xdir="."
  1869. else
  1870. xdir="$xdir"
  1871. fi
  1872. baseobj=`$echo "X$obj" | $Xsed -e 's%^.*/%%'`
  1873. oldobj=`$echo "X$baseobj" | $Xsed -e "$lo2o"`
  1874. if test ! -f $xdir/$oldobj; then
  1875. $show "(cd $xdir && ${LN_S} $baseobj $oldobj)"
  1876. $run eval '(cd $xdir && ${LN_S} $baseobj $oldobj)' || exit $?
  1877. fi
  1878. done
  1879. # Use standard objects if they are pic
  1880. test -z "$pic_flag" && libobjs=`$echo "X$libobjs" | $SP2NL | $Xsed -e "$lo2o" | $NL2SP`
  1881. # Prepare the list of exported symbols
  1882. if test -z "$export_symbols"; then
  1883. if test "$always_export_symbols" = yes || test -n "$export_symbols_regex"; then
  1884. $show "generating symbol list for \`$libname.la'"
  1885. export_symbols="$output_objdir/$libname.exp"
  1886. $run $rm $export_symbols
  1887. eval cmds=\"$export_symbols_cmds\"
  1888. IFS="${IFS= }"; save_ifs="$IFS"; IFS='~'
  1889. for cmd in $cmds; do
  1890. IFS="$save_ifs"
  1891. $show "$cmd"
  1892. $run eval "$cmd" || exit $?
  1893. done
  1894. IFS="$save_ifs"
  1895. if test -n "$export_symbols_regex"; then
  1896. $show "egrep -e \"$export_symbols_regex\" \"$export_symbols\" > \"${export_symbols}T\""
  1897. $run eval 'egrep -e "$export_symbols_regex" "$export_symbols" > "${export_symbols}T"'
  1898. $show "$mv \"${export_symbols}T\" \"$export_symbols\""
  1899. $run eval '$mv "${export_symbols}T" "$export_symbols"'
  1900. fi
  1901. fi
  1902. fi
  1903. if test -n "$export_symbols" && test -n "$include_expsyms"; then
  1904. $run eval '$echo "X$include_expsyms" | $SP2NL >> "$export_symbols"'
  1905. fi
  1906. if test -n "$convenience"; then
  1907. if test -n "$whole_archive_flag_spec"; then
  1908. eval libobjs=\"\$libobjs $whole_archive_flag_spec\"
  1909. else
  1910. gentop="$output_objdir/${outputname}x"
  1911. $show "${rm}r $gentop"
  1912. $run ${rm}r "$gentop"
  1913. $show "mkdir $gentop"
  1914. $run mkdir "$gentop"
  1915. status=$?
  1916. if test $status -ne 0 && test ! -d "$gentop"; then
  1917. exit $status
  1918. fi
  1919. generated="$generated $gentop"
  1920. for xlib in $convenience; do
  1921. # Extract the objects.
  1922. case "$xlib" in
  1923. [\\/]* | [A-Za-z]:[\\/]*) xabs="$xlib" ;;
  1924. *) xabs=`pwd`"/$xlib" ;;
  1925. esac
  1926. xlib=`$echo "X$xlib" | $Xsed -e 's%^.*/%%'`
  1927. xdir="$gentop/$xlib"
  1928. $show "${rm}r $xdir"
  1929. $run ${rm}r "$xdir"
  1930. $show "mkdir $xdir"
  1931. $run mkdir "$xdir"
  1932. status=$?
  1933. if test $status -ne 0 && test ! -d "$xdir"; then
  1934. exit $status
  1935. fi
  1936. $show "(cd $xdir && $AR x $xabs)"
  1937. $run eval "(cd \$xdir && $AR x \$xabs)" || exit $?
  1938. libobjs="$libobjs "`find $xdir -name \*.o -print -o -name \*.lo -print | $NL2SP`
  1939. done
  1940. fi
  1941. fi
  1942. if test "$thread_safe" = yes && test -n "$thread_safe_flag_spec"; then
  1943. eval flag=\"$thread_safe_flag_spec\"
  1944. linkopts="$linkopts $flag"
  1945. fi
  1946. # Do each of the archive commands.
  1947. if test -n "$export_symbols" && test -n "$archive_expsym_cmds"; then
  1948. eval cmds=\"$archive_expsym_cmds\"
  1949. else
  1950. eval cmds=\"$archive_cmds\"
  1951. fi
  1952. IFS="${IFS= }"; save_ifs="$IFS"; IFS='~'
  1953. for cmd in $cmds; do
  1954. IFS="$save_ifs"
  1955. $show "$cmd"
  1956. $run eval "$cmd" || exit $?
  1957. done
  1958. IFS="$save_ifs"
  1959. # Create links to the real library.
  1960. for linkname in $linknames; do
  1961. if test "$realname" != "$linkname"; then
  1962. $show "(cd $output_objdir && $rm $linkname && $LN_S $realname $linkname)"
  1963. $run eval '(cd $output_objdir && $rm $linkname && $LN_S $realname $linkname)' || exit $?
  1964. fi
  1965. done
  1966. # If -module or -export-dynamic was specified, set the dlname.
  1967. if test "$module" = yes || test "$export_dynamic" = yes; then
  1968. # On all known operating systems, these are identical.
  1969. dlname="$soname"
  1970. fi
  1971. fi
  1972. ;;
  1973. *.lo | *.o | *.obj)
  1974. if test -n "$link_against_libtool_libs"; then
  1975. $echo "$modename: error: cannot link libtool libraries into objects" 1>&2
  1976. exit 1
  1977. fi
  1978. if test -n "$deplibs"; then
  1979. $echo "$modename: warning: \`-l' and \`-L' are ignored for objects" 1>&2
  1980. fi
  1981. if test -n "$dlfiles$dlprefiles" || test "$dlself" != no; then
  1982. $echo "$modename: warning: \`-dlopen' is ignored for objects" 1>&2
  1983. fi
  1984. if test -n "$rpath"; then
  1985. $echo "$modename: warning: \`-rpath' is ignored for objects" 1>&2
  1986. fi
  1987. if test -n "$xrpath"; then
  1988. $echo "$modename: warning: \`-R' is ignored for objects" 1>&2
  1989. fi
  1990. if test -n "$vinfo"; then
  1991. $echo "$modename: warning: \`-version-info' is ignored for objects" 1>&2
  1992. fi
  1993. if test -n "$release"; then
  1994. $echo "$modename: warning: \`-release' is ignored for objects" 1>&2
  1995. fi
  1996. case "$output" in
  1997. *.lo)
  1998. if test -n "$objs"; then
  1999. $echo "$modename: cannot build library object \`$output' from non-libtool objects" 1>&2
  2000. exit 1
  2001. fi
  2002. libobj="$output"
  2003. obj=`$echo "X$output" | $Xsed -e "$lo2o"`
  2004. ;;
  2005. *)
  2006. libobj=
  2007. obj="$output"
  2008. ;;
  2009. esac
  2010. # Delete the old objects.
  2011. $run $rm $obj $libobj
  2012. # Objects from convenience libraries. This assumes
  2013. # single-version convenience libraries. Whenever we create
  2014. # different ones for PIC/non-PIC, this we'll have to duplicate
  2015. # the extraction.
  2016. reload_conv_objs=
  2017. gentop=
  2018. # reload_cmds runs $LD directly, so let us get rid of
  2019. # -Wl from whole_archive_flag_spec
  2020. wl=
  2021. if test -n "$convenience"; then
  2022. if test -n "$whole_archive_flag_spec"; then
  2023. eval reload_conv_objs=\"\$reload_objs $whole_archive_flag_spec\"
  2024. else
  2025. gentop="$output_objdir/${obj}x"
  2026. $show "${rm}r $gentop"
  2027. $run ${rm}r "$gentop"
  2028. $show "mkdir $gentop"
  2029. $run mkdir "$gentop"
  2030. status=$?
  2031. if test $status -ne 0 && test ! -d "$gentop"; then
  2032. exit $status
  2033. fi
  2034. generated="$generated $gentop"
  2035. for xlib in $convenience; do
  2036. # Extract the objects.
  2037. case "$xlib" in
  2038. [\\/]* | [A-Za-z]:[\\/]*) xabs="$xlib" ;;
  2039. *) xabs=`pwd`"/$xlib" ;;
  2040. esac
  2041. xlib=`$echo "X$xlib" | $Xsed -e 's%^.*/%%'`
  2042. xdir="$gentop/$xlib"
  2043. $show "${rm}r $xdir"
  2044. $run ${rm}r "$xdir"
  2045. $show "mkdir $xdir"
  2046. $run mkdir "$xdir"
  2047. status=$?
  2048. if test $status -ne 0 && test ! -d "$xdir"; then
  2049. exit $status
  2050. fi
  2051. $show "(cd $xdir && $AR x $xabs)"
  2052. $run eval "(cd \$xdir && $AR x \$xabs)" || exit $?
  2053. reload_conv_objs="$reload_objs "`find $xdir -name \*.o -print -o -name \*.lo -print | $NL2SP`
  2054. done
  2055. fi
  2056. fi
  2057. # Create the old-style object.
  2058. reload_objs="$objs "`$echo "X$libobjs" | $SP2NL | $Xsed -e '/\.'${libext}$'/d' -e '/\.lib$/d' -e "$lo2o" | $NL2SP`" $reload_conv_objs"
  2059. output="$obj"
  2060. eval cmds=\"$reload_cmds\"
  2061. IFS="${IFS= }"; save_ifs="$IFS"; IFS='~'
  2062. for cmd in $cmds; do
  2063. IFS="$save_ifs"
  2064. $show "$cmd"
  2065. $run eval "$cmd" || exit $?
  2066. done
  2067. IFS="$save_ifs"
  2068. # Exit if we aren't doing a library object file.
  2069. if test -z "$libobj"; then
  2070. if test -n "$gentop"; then
  2071. $show "${rm}r $gentop"
  2072. $run ${rm}r $gentop
  2073. fi
  2074. exit 0
  2075. fi
  2076. if test "$build_libtool_libs" != yes; then
  2077. if test -n "$gentop"; then
  2078. $show "${rm}r $gentop"
  2079. $run ${rm}r $gentop
  2080. fi
  2081. # Create an invalid libtool object if no PIC, so that we don't
  2082. # accidentally link it into a program.
  2083. $show "echo timestamp > $libobj"
  2084. $run eval "echo timestamp > $libobj" || exit $?
  2085. exit 0
  2086. fi
  2087. if test -n "$pic_flag"; then
  2088. # Only do commands if we really have different PIC objects.
  2089. reload_objs="$libobjs $reload_conv_objs"
  2090. output="$libobj"
  2091. eval cmds=\"$reload_cmds\"
  2092. IFS="${IFS= }"; save_ifs="$IFS"; IFS='~'
  2093. for cmd in $cmds; do
  2094. IFS="$save_ifs"
  2095. $show "$cmd"
  2096. $run eval "$cmd" || exit $?
  2097. done
  2098. IFS="$save_ifs"
  2099. else
  2100. # Just create a symlink.
  2101. $show $rm $libobj
  2102. $run $rm $libobj
  2103. xdir=`$echo "X$libobj" | $Xsed -e 's%/[^/]*$%%'`
  2104. if test "X$xdir" = "X$libobj"; then
  2105. xdir="."
  2106. else
  2107. xdir="$xdir"
  2108. fi
  2109. baseobj=`$echo "X$libobj" | $Xsed -e 's%^.*/%%'`
  2110. oldobj=`$echo "X$baseobj" | $Xsed -e "$lo2o"`
  2111. $show "(cd $xdir && $LN_S $oldobj $baseobj)"
  2112. $run eval '(cd $xdir && $LN_S $oldobj $baseobj)' || exit $?
  2113. fi
  2114. if test -n "$gentop"; then
  2115. $show "${rm}r $gentop"
  2116. $run ${rm}r $gentop
  2117. fi
  2118. exit 0
  2119. ;;
  2120. # Anything else should be a program.
  2121. *)
  2122. if test -n "$vinfo"; then
  2123. $echo "$modename: warning: \`-version-info' is ignored for programs" 1>&2
  2124. fi
  2125. if test -n "$release"; then
  2126. $echo "$modename: warning: \`-release' is ignored for programs" 1>&2
  2127. fi
  2128. if test "$preload" = yes; then
  2129. if test "$dlopen" = unknown && test "$dlopen_self" = unknown &&
  2130. test "$dlopen_self_static" = unknown; then
  2131. $echo "$modename: warning: \`AC_LIBTOOL_DLOPEN' not used. Assuming no dlopen support."
  2132. fi
  2133. fi
  2134. if test -n "$rpath$xrpath"; then
  2135. # If the user specified any rpath flags, then add them.
  2136. for libdir in $rpath $xrpath; do
  2137. # This is the magic to use -rpath.
  2138. case "$compile_rpath " in
  2139. *" $libdir "*) ;;
  2140. *) compile_rpath="$compile_rpath $libdir" ;;
  2141. esac
  2142. case "$finalize_rpath " in
  2143. *" $libdir "*) ;;
  2144. *) finalize_rpath="$finalize_rpath $libdir" ;;
  2145. esac
  2146. done
  2147. fi
  2148. # Now hardcode the library paths
  2149. rpath=
  2150. hardcode_libdirs=
  2151. for libdir in $compile_rpath $finalize_rpath; do
  2152. if test -n "$hardcode_libdir_flag_spec"; then
  2153. if test -n "$hardcode_libdir_separator"; then
  2154. if test -z "$hardcode_libdirs"; then
  2155. hardcode_libdirs="$libdir"
  2156. else
  2157. # Just accumulate the unique libdirs.
  2158. case "$hardcode_libdir_separator$hardcode_libdirs$hardcode_libdir_separator" in
  2159. *"$hardcode_libdir_separator$libdir$hardcode_libdir_separator"*)
  2160. ;;
  2161. *)
  2162. hardcode_libdirs="$hardcode_libdirs$hardcode_libdir_separator$libdir"
  2163. ;;
  2164. esac
  2165. fi
  2166. else
  2167. eval flag=\"$hardcode_libdir_flag_spec\"
  2168. rpath="$rpath $flag"
  2169. fi
  2170. elif test -n "$runpath_var"; then
  2171. case "$perm_rpath " in
  2172. *" $libdir "*) ;;
  2173. *) perm_rpath="$perm_rpath $libdir" ;;
  2174. esac
  2175. fi
  2176. done
  2177. # Substitute the hardcoded libdirs into the rpath.
  2178. if test -n "$hardcode_libdir_separator" &&
  2179. test -n "$hardcode_libdirs"; then
  2180. libdir="$hardcode_libdirs"
  2181. eval rpath=\" $hardcode_libdir_flag_spec\"
  2182. fi
  2183. compile_rpath="$rpath"
  2184. rpath=
  2185. hardcode_libdirs=
  2186. for libdir in $finalize_rpath; do
  2187. if test -n "$hardcode_libdir_flag_spec"; then
  2188. if test -n "$hardcode_libdir_separator"; then
  2189. if test -z "$hardcode_libdirs"; then
  2190. hardcode_libdirs="$libdir"
  2191. else
  2192. # Just accumulate the unique libdirs.
  2193. case "$hardcode_libdir_separator$hardcode_libdirs$hardcode_libdir_separator" in
  2194. *"$hardcode_libdir_separator$libdir$hardcode_libdir_separator"*)
  2195. ;;
  2196. *)
  2197. hardcode_libdirs="$hardcode_libdirs$hardcode_libdir_separator$libdir"
  2198. ;;
  2199. esac
  2200. fi
  2201. else
  2202. eval flag=\"$hardcode_libdir_flag_spec\"
  2203. rpath="$rpath $flag"
  2204. fi
  2205. elif test -n "$runpath_var"; then
  2206. case "$finalize_perm_rpath " in
  2207. *" $libdir "*) ;;
  2208. *) finalize_perm_rpath="$finalize_perm_rpath $libdir" ;;
  2209. esac
  2210. fi
  2211. done
  2212. # Substitute the hardcoded libdirs into the rpath.
  2213. if test -n "$hardcode_libdir_separator" &&
  2214. test -n "$hardcode_libdirs"; then
  2215. libdir="$hardcode_libdirs"
  2216. eval rpath=\" $hardcode_libdir_flag_spec\"
  2217. fi
  2218. finalize_rpath="$rpath"
  2219. output_objdir=`$echo "X$output" | $Xsed -e 's%/[^/]*$%%'`
  2220. if test "X$output_objdir" = "X$output"; then
  2221. output_objdir="$objdir"
  2222. else
  2223. output_objdir="$output_objdir/$objdir"
  2224. fi
  2225. # Create the binary in the object directory, then wrap it.
  2226. if test ! -d $output_objdir; then
  2227. $show "$mkdir $output_objdir"
  2228. $run $mkdir $output_objdir
  2229. status=$?
  2230. if test $status -ne 0 && test ! -d $output_objdir; then
  2231. exit $status
  2232. fi
  2233. fi
  2234. if test -n "$libobjs" && test "$build_old_libs" = yes; then
  2235. # Transform all the library objects into standard objects.
  2236. compile_command=`$echo "X$compile_command" | $SP2NL | $Xsed -e "$lo2o" | $NL2SP`
  2237. finalize_command=`$echo "X$finalize_command" | $SP2NL | $Xsed -e "$lo2o" | $NL2SP`
  2238. fi
  2239. dlsyms=
  2240. if test -n "$dlfiles$dlprefiles" || test "$dlself" != no; then
  2241. if test -n "$NM" && test -n "$global_symbol_pipe"; then
  2242. dlsyms="${outputname}S.c"
  2243. else
  2244. $echo "$modename: not configured to extract global symbols from dlpreopened files" 1>&2
  2245. fi
  2246. fi
  2247. if test -n "$dlsyms"; then
  2248. case "$dlsyms" in
  2249. "") ;;
  2250. *.c)
  2251. # Discover the nlist of each of the dlfiles.
  2252. nlist="$output_objdir/${outputname}.nm"
  2253. $show "$rm $nlist ${nlist}S ${nlist}T"
  2254. $run $rm "$nlist" "${nlist}S" "${nlist}T"
  2255. # Parse the name list into a source file.
  2256. $show "creating $output_objdir/$dlsyms"
  2257. test -z "$run" && $echo > "$output_objdir/$dlsyms" "\
  2258. /* $dlsyms - symbol resolution table for \`$outputname' dlsym emulation. */
  2259. /* Generated by $PROGRAM - GNU $PACKAGE $VERSION$TIMESTAMP */
  2260. #ifdef __cplusplus
  2261. extern \"C\" {
  2262. #endif
  2263. /* Prevent the only kind of declaration conflicts we can make. */
  2264. #define lt_preloaded_symbols some_other_symbol
  2265. /* External symbol declarations for the compiler. */\
  2266. "
  2267. if test "$dlself" = yes; then
  2268. $show "generating symbol list for \`$output'"
  2269. test -z "$run" && $echo ': @PROGRAM@ ' > "$nlist"
  2270. # Add our own program objects to the symbol list.
  2271. progfiles=`$echo "X$objs" | $SP2NL | $Xsed -e "$lo2o" | $NL2SP`
  2272. for arg in $progfiles; do
  2273. $show "extracting global C symbols from \`$arg'"
  2274. $run eval "$NM $arg | $global_symbol_pipe >> '$nlist'"
  2275. done
  2276. if test -n "$exclude_expsyms"; then
  2277. $run eval 'egrep -v " ($exclude_expsyms)$" "$nlist" > "$nlist"T'
  2278. $run eval '$mv "$nlist"T "$nlist"'
  2279. fi
  2280. if test -n "$export_symbols_regex"; then
  2281. $run eval 'egrep -e "$export_symbols_regex" "$nlist" > "$nlist"T'
  2282. $run eval '$mv "$nlist"T "$nlist"'
  2283. fi
  2284. # Prepare the list of exported symbols
  2285. if test -z "$export_symbols"; then
  2286. export_symbols="$output_objdir/$output.exp"
  2287. $run $rm $export_symbols
  2288. $run eval "sed -n -e '/^: @PROGRAM@$/d' -e 's/^.* \(.*\)$/\1/p' "'< "$nlist" > "$export_symbols"'
  2289. else
  2290. $run eval "sed -e 's/\([][.*^$]\)/\\\1/g' -e 's/^/ /' -e 's/$/$/'"' < "$export_symbols" > "$output_objdir/$output.exp"'
  2291. $run eval 'grep -f "$output_objdir/$output.exp" < "$nlist" > "$nlist"T'
  2292. $run eval 'mv "$nlist"T "$nlist"'
  2293. fi
  2294. fi
  2295. for arg in $dlprefiles; do
  2296. $show "extracting global C symbols from \`$arg'"
  2297. name=`echo "$arg" | sed -e 's%^.*/%%'`
  2298. $run eval 'echo ": $name " >> "$nlist"'
  2299. $run eval "$NM $arg | $global_symbol_pipe >> '$nlist'"
  2300. done
  2301. if test -z "$run"; then
  2302. # Make sure we have at least an empty file.
  2303. test -f "$nlist" || : > "$nlist"
  2304. if test -n "$exclude_expsyms"; then
  2305. egrep -v " ($exclude_expsyms)$" "$nlist" > "$nlist"T
  2306. $mv "$nlist"T "$nlist"
  2307. fi
  2308. # Try sorting and uniquifying the output.
  2309. if grep -v "^: " < "$nlist" | sort +2 | uniq > "$nlist"S; then
  2310. :
  2311. else
  2312. grep -v "^: " < "$nlist" > "$nlist"S
  2313. fi
  2314. if test -f "$nlist"S; then
  2315. eval "$global_symbol_to_cdecl"' < "$nlist"S >> "$output_objdir/$dlsyms"'
  2316. else
  2317. echo '/* NONE */' >> "$output_objdir/$dlsyms"
  2318. fi
  2319. $echo >> "$output_objdir/$dlsyms" "\
  2320. #undef lt_preloaded_symbols
  2321. #if defined (__STDC__) && __STDC__
  2322. # define lt_ptr_t void *
  2323. #else
  2324. # define lt_ptr_t char *
  2325. # define const
  2326. #endif
  2327. /* The mapping between symbol names and symbols. */
  2328. const struct {
  2329. const char *name;
  2330. lt_ptr_t address;
  2331. }
  2332. lt_preloaded_symbols[] =
  2333. {\
  2334. "
  2335. sed -n -e 's/^: \([^ ]*\) $/ {\"\1\", (lt_ptr_t) 0},/p' \
  2336. -e 's/^. \([^ ]*\) \([^ ]*\)$/ {"\2", (lt_ptr_t) \&\2},/p' \
  2337. < "$nlist" >> "$output_objdir/$dlsyms"
  2338. $echo >> "$output_objdir/$dlsyms" "\
  2339. {0, (lt_ptr_t) 0}
  2340. };
  2341. /* This works around a problem in FreeBSD linker */
  2342. #ifdef FREEBSD_WORKAROUND
  2343. static const void *lt_preloaded_setup() {
  2344. return lt_preloaded_symbols;
  2345. }
  2346. #endif
  2347. #ifdef __cplusplus
  2348. }
  2349. #endif\
  2350. "
  2351. fi
  2352. pic_flag_for_symtable=
  2353. case "$host" in
  2354. # compiling the symbol table file with pic_flag works around
  2355. # a FreeBSD bug that causes programs to crash when -lm is
  2356. # linked before any other PIC object. But we must not use
  2357. # pic_flag when linking with -static. The problem exists in
  2358. # FreeBSD 2.2.6 and is fixed in FreeBSD 3.1.
  2359. *-*-freebsd2*|*-*-freebsd3.0*|*-*-freebsdelf3.0*)
  2360. case "$compile_command " in
  2361. *" -static "*) ;;
  2362. *) pic_flag_for_symtable=" $pic_flag -DPIC -DFREEBSD_WORKAROUND";;
  2363. esac;;
  2364. *-*-hpux*)
  2365. case "$compile_command " in
  2366. *" -static "*) ;;
  2367. *) pic_flag_for_symtable=" $pic_flag -DPIC";;
  2368. esac
  2369. esac
  2370. # Now compile the dynamic symbol file.
  2371. $show "(cd $output_objdir && $CC -c$no_builtin_flag$pic_flag_for_symtable \"$dlsyms\")"
  2372. $run eval '(cd $output_objdir && $CC -c$no_builtin_flag$pic_flag_for_symtable "$dlsyms")' || exit $?
  2373. # Clean up the generated files.
  2374. $show "$rm $output_objdir/$dlsyms $nlist ${nlist}S ${nlist}T"
  2375. $run $rm "$output_objdir/$dlsyms" "$nlist" "${nlist}S" "${nlist}T"
  2376. # Transform the symbol file into the correct name.
  2377. compile_command=`$echo "X$compile_command" | $Xsed -e "s%@SYMFILE@%$output_objdir/${outputname}S.${objext}%"`
  2378. finalize_command=`$echo "X$finalize_command" | $Xsed -e "s%@SYMFILE@%$output_objdir/${outputname}S.${objext}%"`
  2379. ;;
  2380. *)
  2381. $echo "$modename: unknown suffix for \`$dlsyms'" 1>&2
  2382. exit 1
  2383. ;;
  2384. esac
  2385. else
  2386. # We keep going just in case the user didn't refer to
  2387. # lt_preloaded_symbols. The linker will fail if global_symbol_pipe
  2388. # really was required.
  2389. # Nullify the symbol file.
  2390. compile_command=`$echo "X$compile_command" | $Xsed -e "s% @SYMFILE@%%"`
  2391. finalize_command=`$echo "X$finalize_command" | $Xsed -e "s% @SYMFILE@%%"`
  2392. fi
  2393. if test -z "$link_against_libtool_libs" || test "$build_libtool_libs" != yes; then
  2394. # Replace the output file specification.
  2395. compile_command=`$echo "X$compile_command" | $Xsed -e 's%@OUTPUT@%'"$output"'%g'`
  2396. link_command="$compile_command$compile_rpath"
  2397. # We have no uninstalled library dependencies, so finalize right now.
  2398. $show "$link_command"
  2399. $run eval "$link_command"
  2400. status=$?
  2401. # Delete the generated files.
  2402. if test -n "$dlsyms"; then
  2403. $show "$rm $output_objdir/${outputname}S.${objext}"
  2404. $run $rm "$output_objdir/${outputname}S.${objext}"
  2405. fi
  2406. exit $status
  2407. fi
  2408. if test -n "$shlibpath_var"; then
  2409. # We should set the shlibpath_var
  2410. rpath=
  2411. for dir in $temp_rpath; do
  2412. case "$dir" in
  2413. [\\/]* | [A-Za-z]:[\\/]*)
  2414. # Absolute path.
  2415. rpath="$rpath$dir:"
  2416. ;;
  2417. *)
  2418. # Relative path: add a thisdir entry.
  2419. rpath="$rpath\$thisdir/$dir:"
  2420. ;;
  2421. esac
  2422. done
  2423. temp_rpath="$rpath"
  2424. fi
  2425. if test -n "$compile_shlibpath$finalize_shlibpath"; then
  2426. compile_command="$shlibpath_var=\"$compile_shlibpath$finalize_shlibpath\$$shlibpath_var\" $compile_command"
  2427. fi
  2428. if test -n "$finalize_shlibpath"; then
  2429. finalize_command="$shlibpath_var=\"$finalize_shlibpath\$$shlibpath_var\" $finalize_command"
  2430. fi
  2431. compile_var=
  2432. finalize_var=
  2433. if test -n "$runpath_var"; then
  2434. if test -n "$perm_rpath"; then
  2435. # We should set the runpath_var.
  2436. rpath=
  2437. for dir in $perm_rpath; do
  2438. rpath="$rpath$dir:"
  2439. done
  2440. compile_var="$runpath_var=\"$rpath\$$runpath_var\" "
  2441. fi
  2442. if test -n "$finalize_perm_rpath"; then
  2443. # We should set the runpath_var.
  2444. rpath=
  2445. for dir in $finalize_perm_rpath; do
  2446. rpath="$rpath$dir:"
  2447. done
  2448. finalize_var="$runpath_var=\"$rpath\$$runpath_var\" "
  2449. fi
  2450. fi
  2451. if test "$hardcode_action" = relink; then
  2452. # Fast installation is not supported
  2453. link_command="$compile_var$compile_command$compile_rpath"
  2454. relink_command="$finalize_var$finalize_command$finalize_rpath"
  2455. $echo "$modename: warning: this platform does not like uninstalled shared libraries" 1>&2
  2456. $echo "$modename: \`$output' will be relinked during installation" 1>&2
  2457. else
  2458. if test "$fast_install" != no; then
  2459. link_command="$finalize_var$compile_command$finalize_rpath"
  2460. if test "$fast_install" = yes; then
  2461. relink_command=`$echo "X$compile_var$compile_command$compile_rpath" | $Xsed -e 's%@OUTPUT@%\$progdir/\$file%g'`
  2462. else
  2463. # fast_install is set to needless
  2464. relink_command=
  2465. fi
  2466. else
  2467. link_command="$compile_var$compile_command$compile_rpath"
  2468. relink_command="$finalize_var$finalize_command$finalize_rpath"
  2469. fi
  2470. fi
  2471. # Replace the output file specification.
  2472. link_command=`$echo "X$link_command" | $Xsed -e 's%@OUTPUT@%'"$output_objdir/$outputname"'%g'`
  2473. # Delete the old output files.
  2474. $run $rm $output $output_objdir/$outputname $output_objdir/lt-$outputname
  2475. $show "$link_command"
  2476. $run eval "$link_command" || exit $?
  2477. # Now create the wrapper script.
  2478. $show "creating $output"
  2479. # Quote the relink command for shipping.
  2480. if test -n "$relink_command"; then
  2481. relink_command=`$echo "X$relink_command" | $Xsed -e "$sed_quote_subst"`
  2482. fi
  2483. # Quote $echo for shipping.
  2484. if test "X$echo" = "X$SHELL $0 --fallback-echo"; then
  2485. case "$0" in
  2486. [\\/]* | [A-Za-z]:[\\/]*) qecho="$SHELL $0 --fallback-echo";;
  2487. *) qecho="$SHELL `pwd`/$0 --fallback-echo";;
  2488. esac
  2489. qecho=`$echo "X$qecho" | $Xsed -e "$sed_quote_subst"`
  2490. else
  2491. qecho=`$echo "X$echo" | $Xsed -e "$sed_quote_subst"`
  2492. fi
  2493. # Only actually do things if our run command is non-null.
  2494. if test -z "$run"; then
  2495. # win32 will think the script is a binary if it has
  2496. # a .exe suffix, so we strip it off here.
  2497. case $output in
  2498. *.exe) output=`echo $output|sed 's,.exe$,,'` ;;
  2499. esac
  2500. $rm $output
  2501. trap "$rm $output; exit 1" 1 2 15
  2502. $echo > $output "\
  2503. #! $SHELL
  2504. # $output - temporary wrapper script for $objdir/$outputname
  2505. # Generated by $PROGRAM - GNU $PACKAGE $VERSION$TIMESTAMP
  2506. #
  2507. # The $output program cannot be directly executed until all the libtool
  2508. # libraries that it depends on are installed.
  2509. #
  2510. # This wrapper script should never be moved out of the build directory.
  2511. # If it is, it will not operate correctly.
  2512. # Sed substitution that helps us do robust quoting. It backslashifies
  2513. # metacharacters that are still active within double-quoted strings.
  2514. Xsed='sed -e 1s/^X//'
  2515. sed_quote_subst='$sed_quote_subst'
  2516. # The HP-UX ksh and POSIX shell print the target directory to stdout
  2517. # if CDPATH is set.
  2518. if test \"\${CDPATH+set}\" = set; then CDPATH=:; export CDPATH; fi
  2519. relink_command=\"$relink_command\"
  2520. # This environment variable determines our operation mode.
  2521. if test \"\$libtool_install_magic\" = \"$magic\"; then
  2522. # install mode needs the following variable:
  2523. link_against_libtool_libs='$link_against_libtool_libs'
  2524. else
  2525. # When we are sourced in execute mode, \$file and \$echo are already set.
  2526. if test \"\$libtool_execute_magic\" != \"$magic\"; then
  2527. echo=\"$qecho\"
  2528. file=\"\$0\"
  2529. # Make sure echo works.
  2530. if test \"X\$1\" = X--no-reexec; then
  2531. # Discard the --no-reexec flag, and continue.
  2532. shift
  2533. elif test \"X\`(\$echo '\t') 2>/dev/null\`\" = 'X\t'; then
  2534. # Yippee, \$echo works!
  2535. :
  2536. else
  2537. # Restart under the correct shell, and then maybe \$echo will work.
  2538. exec $SHELL \"\$0\" --no-reexec \${1+\"\$@\"}
  2539. fi
  2540. fi\
  2541. "
  2542. $echo >> $output "\
  2543. # Find the directory that this script lives in.
  2544. thisdir=\`\$echo \"X\$file\" | \$Xsed -e 's%/[^/]*$%%'\`
  2545. test \"x\$thisdir\" = \"x\$file\" && thisdir=.
  2546. # Follow symbolic links until we get to the real thisdir.
  2547. file=\`ls -ld \"\$file\" | sed -n 's/.*-> //p'\`
  2548. while test -n \"\$file\"; do
  2549. destdir=\`\$echo \"X\$file\" | \$Xsed -e 's%/[^/]*\$%%'\`
  2550. # If there was a directory component, then change thisdir.
  2551. if test \"x\$destdir\" != \"x\$file\"; then
  2552. case \"\$destdir\" in
  2553. [\\/]* | [A-Za-z]:[\\/]*) thisdir=\"\$destdir\" ;;
  2554. *) thisdir=\"\$thisdir/\$destdir\" ;;
  2555. esac
  2556. fi
  2557. file=\`\$echo \"X\$file\" | \$Xsed -e 's%^.*/%%'\`
  2558. file=\`ls -ld \"\$thisdir/\$file\" | sed -n 's/.*-> //p'\`
  2559. done
  2560. # Try to get the absolute directory name.
  2561. absdir=\`cd \"\$thisdir\" && pwd\`
  2562. test -n \"\$absdir\" && thisdir=\"\$absdir\"
  2563. "
  2564. if test "$fast_install" = yes; then
  2565. echo >> $output "\
  2566. program=lt-'$outputname'
  2567. progdir=\"\$thisdir/$objdir\"
  2568. if test ! -f \"\$progdir/\$program\" || \\
  2569. { file=\`ls -1dt \"\$progdir/\$program\" \"\$progdir/../\$program\" 2>/dev/null | sed 1q\`; \\
  2570. test \"X\$file\" != \"X\$progdir/\$program\"; }; then
  2571. file=\"\$\$-\$program\"
  2572. if test ! -d \"\$progdir\"; then
  2573. $mkdir \"\$progdir\"
  2574. else
  2575. $rm \"\$progdir/\$file\"
  2576. fi"
  2577. echo >> $output "\
  2578. # relink executable if necessary
  2579. if test -n \"\$relink_command\"; then
  2580. if (cd \"\$thisdir\" && eval \$relink_command); then :
  2581. else
  2582. $rm \"\$progdir/\$file\"
  2583. exit 1
  2584. fi
  2585. fi
  2586. $mv \"\$progdir/\$file\" \"\$progdir/\$program\" 2>/dev/null ||
  2587. { $rm \"\$progdir/\$program\";
  2588. $mv \"\$progdir/\$file\" \"\$progdir/\$program\"; }
  2589. $rm \"\$progdir/\$file\"
  2590. fi"
  2591. else
  2592. echo >> $output "\
  2593. program='$outputname'
  2594. progdir=\"\$thisdir/$objdir\"
  2595. "
  2596. fi
  2597. echo >> $output "\
  2598. if test -f \"\$progdir/\$program\"; then"
  2599. # Export our shlibpath_var if we have one.
  2600. if test "$shlibpath_overrides_runpath" = yes && test -n "$shlibpath_var" && test -n "$temp_rpath"; then
  2601. $echo >> $output "\
  2602. # Add our own library path to $shlibpath_var
  2603. $shlibpath_var=\"$temp_rpath\$$shlibpath_var\"
  2604. # Some systems cannot cope with colon-terminated $shlibpath_var
  2605. # The second colon is a workaround for a bug in BeOS R4 sed
  2606. $shlibpath_var=\`\$echo \"X\$$shlibpath_var\" | \$Xsed -e 's/::*\$//'\`
  2607. export $shlibpath_var
  2608. "
  2609. fi
  2610. # fixup the dll searchpath if we need to.
  2611. if test -n "$dllsearchpath"; then
  2612. $echo >> $output "\
  2613. # Add the dll search path components to the executable PATH
  2614. PATH=$dllsearchpath:\$PATH
  2615. "
  2616. fi
  2617. $echo >> $output "\
  2618. if test \"\$libtool_execute_magic\" != \"$magic\"; then
  2619. # Run the actual program with our arguments.
  2620. "
  2621. case $host in
  2622. *-*-cygwin* | *-*-mingw | *-*-os2*)
  2623. # win32 systems need to use the prog path for dll
  2624. # lookup to work
  2625. $echo >> $output "\
  2626. exec \$progdir\\\\\$program \${1+\"\$@\"}
  2627. "
  2628. ;;
  2629. *)
  2630. $echo >> $output "\
  2631. # Export the path to the program.
  2632. PATH=\"\$progdir:\$PATH\"
  2633. export PATH
  2634. exec \$program \${1+\"\$@\"}
  2635. "
  2636. ;;
  2637. esac
  2638. $echo >> $output "\
  2639. \$echo \"\$0: cannot exec \$program \${1+\"\$@\"}\"
  2640. exit 1
  2641. fi
  2642. else
  2643. # The program doesn't exist.
  2644. \$echo \"\$0: error: \$progdir/\$program does not exist\" 1>&2
  2645. \$echo \"This script is just a wrapper for \$program.\" 1>&2
  2646. echo \"See the $PACKAGE documentation for more information.\" 1>&2
  2647. exit 1
  2648. fi
  2649. fi\
  2650. "
  2651. chmod +x $output
  2652. fi
  2653. exit 0
  2654. ;;
  2655. esac
  2656. # See if we need to build an old-fashioned archive.
  2657. for oldlib in $oldlibs; do
  2658. if test "$build_libtool_libs" = convenience; then
  2659. oldobjs="$libobjs_save"
  2660. addlibs="$convenience"
  2661. build_libtool_libs=no
  2662. else
  2663. if test "$build_libtool_libs" = module; then
  2664. oldobjs="$libobjs_save"
  2665. build_libtool_libs=no
  2666. else
  2667. oldobjs="$objs "`$echo "X$libobjs_save" | $SP2NL | $Xsed -e '/\.'${libext}'$/d' -e '/\.lib$/d' -e "$lo2o" | $NL2SP`
  2668. fi
  2669. addlibs="$old_convenience"
  2670. fi
  2671. if test -n "$addlibs"; then
  2672. gentop="$output_objdir/${outputname}x"
  2673. $show "${rm}r $gentop"
  2674. $run ${rm}r "$gentop"
  2675. $show "mkdir $gentop"
  2676. $run mkdir "$gentop"
  2677. status=$?
  2678. if test $status -ne 0 && test ! -d "$gentop"; then
  2679. exit $status
  2680. fi
  2681. generated="$generated $gentop"
  2682. # Add in members from convenience archives.
  2683. for xlib in $addlibs; do
  2684. # Extract the objects.
  2685. case "$xlib" in
  2686. [\\/]* | [A-Za-z]:[\\/]*) xabs="$xlib" ;;
  2687. *) xabs=`pwd`"/$xlib" ;;
  2688. esac
  2689. xlib=`$echo "X$xlib" | $Xsed -e 's%^.*/%%'`
  2690. xdir="$gentop/$xlib"
  2691. $show "${rm}r $xdir"
  2692. $run ${rm}r "$xdir"
  2693. $show "mkdir $xdir"
  2694. $run mkdir "$xdir"
  2695. status=$?
  2696. if test $status -ne 0 && test ! -d "$xdir"; then
  2697. exit $status
  2698. fi
  2699. $show "(cd $xdir && $AR x $xabs)"
  2700. $run eval "(cd \$xdir && $AR x \$xabs)" || exit $?
  2701. oldobjs="$oldobjs "`find $xdir -name \*.${objext} -print -o -name \*.lo -print | $NL2SP`
  2702. done
  2703. fi
  2704. # Do each command in the archive commands.
  2705. if test -n "$old_archive_from_new_cmds" && test "$build_libtool_libs" = yes; then
  2706. eval cmds=\"$old_archive_from_new_cmds\"
  2707. else
  2708. # Ensure that we have .o objects in place in case we decided
  2709. # not to build a shared library, and have fallen back to building
  2710. # static libs even though --disable-static was passed!
  2711. for oldobj in $oldobjs; do
  2712. if test ! -f $oldobj; then
  2713. xdir=`$echo "X$oldobj" | $Xsed -e 's%/[^/]*$%%'`
  2714. if test "X$xdir" = "X$oldobj"; then
  2715. xdir="."
  2716. else
  2717. xdir="$xdir"
  2718. fi
  2719. baseobj=`$echo "X$oldobj" | $Xsed -e 's%^.*/%%'`
  2720. obj=`$echo "X$baseobj" | $Xsed -e "$o2lo"`
  2721. $show "(cd $xdir && ${LN_S} $obj $baseobj)"
  2722. $run eval '(cd $xdir && ${LN_S} $obj $baseobj)' || exit $?
  2723. fi
  2724. done
  2725. eval cmds=\"$old_archive_cmds\"
  2726. fi
  2727. IFS="${IFS= }"; save_ifs="$IFS"; IFS='~'
  2728. for cmd in $cmds; do
  2729. IFS="$save_ifs"
  2730. $show "$cmd"
  2731. $run eval "$cmd" || exit $?
  2732. done
  2733. IFS="$save_ifs"
  2734. done
  2735. if test -n "$generated"; then
  2736. $show "${rm}r$generated"
  2737. $run ${rm}r$generated
  2738. fi
  2739. # Now create the libtool archive.
  2740. case "$output" in
  2741. *.la)
  2742. old_library=
  2743. test "$build_old_libs" = yes && old_library="$libname.$libext"
  2744. $show "creating $output"
  2745. if test -n "$xrpath"; then
  2746. temp_xrpath=
  2747. for libdir in $xrpath; do
  2748. temp_xrpath="$temp_xrpath -R$libdir"
  2749. done
  2750. dependency_libs="$temp_xrpath $dependency_libs"
  2751. fi
  2752. # Only create the output if not a dry run.
  2753. if test -z "$run"; then
  2754. for installed in no yes; do
  2755. if test "$installed" = yes; then
  2756. if test -z "$install_libdir"; then
  2757. break
  2758. fi
  2759. output="$output_objdir/$outputname"i
  2760. fi
  2761. $rm $output
  2762. $echo > $output "\
  2763. # $outputname - a libtool library file
  2764. # Generated by $PROGRAM - GNU $PACKAGE $VERSION$TIMESTAMP
  2765. #
  2766. # Please DO NOT delete this file!
  2767. # It is necessary for linking the library.
  2768. # The name that we can dlopen(3).
  2769. dlname='$dlname'
  2770. # Names of this library.
  2771. library_names='$library_names'
  2772. # The name of the static archive.
  2773. old_library='$old_library'
  2774. # Libraries that this one depends upon.
  2775. dependency_libs='$dependency_libs'
  2776. # Version information for $libname.
  2777. current=$current
  2778. age=$age
  2779. revision=$revision
  2780. # Is this an already installed library?
  2781. installed=$installed
  2782. # Directory that this library needs to be installed in:
  2783. libdir='$install_libdir'\
  2784. "
  2785. done
  2786. fi
  2787. # Do a symbolic link so that the libtool archive can be found in
  2788. # LD_LIBRARY_PATH before the program is installed.
  2789. $show "(cd $output_objdir && $rm $outputname && $LN_S ../$outputname $outputname)"
  2790. $run eval "(cd $output_objdir && $rm $outputname && $LN_S ../$outputname $outputname)" || exit $?
  2791. ;;
  2792. esac
  2793. exit 0
  2794. ;;
  2795. # libtool install mode
  2796. install)
  2797. modename="$modename: install"
  2798. # There may be an optional sh(1) argument at the beginning of
  2799. # install_prog (especially on Windows NT).
  2800. if test "$nonopt" = "$SHELL" || test "$nonopt" = /bin/sh; then
  2801. # Aesthetically quote it.
  2802. arg=`$echo "X$nonopt" | $Xsed -e "$sed_quote_subst"`
  2803. case "$arg" in
  2804. *[\[\~\#\^\&\*\(\)\{\}\|\;\<\>\?\'\ \ ]*|*]*)
  2805. arg="\"$arg\""
  2806. ;;
  2807. esac
  2808. install_prog="$arg "
  2809. arg="$1"
  2810. shift
  2811. else
  2812. install_prog=
  2813. arg="$nonopt"
  2814. fi
  2815. # The real first argument should be the name of the installation program.
  2816. # Aesthetically quote it.
  2817. arg=`$echo "X$arg" | $Xsed -e "$sed_quote_subst"`
  2818. case "$arg" in
  2819. *[\[\~\#\^\&\*\(\)\{\}\|\;\<\>\?\'\ \ ]*|*]*)
  2820. arg="\"$arg\""
  2821. ;;
  2822. esac
  2823. install_prog="$install_prog$arg"
  2824. # We need to accept at least all the BSD install flags.
  2825. dest=
  2826. files=
  2827. opts=
  2828. prev=
  2829. install_type=
  2830. isdir=no
  2831. stripme=
  2832. for arg
  2833. do
  2834. if test -n "$dest"; then
  2835. files="$files $dest"
  2836. dest="$arg"
  2837. continue
  2838. fi
  2839. case "$arg" in
  2840. -d) isdir=yes ;;
  2841. -f) prev="-f" ;;
  2842. -g) prev="-g" ;;
  2843. -m) prev="-m" ;;
  2844. -o) prev="-o" ;;
  2845. -s)
  2846. stripme=" -s"
  2847. continue
  2848. ;;
  2849. -*) ;;
  2850. *)
  2851. # If the previous option needed an argument, then skip it.
  2852. if test -n "$prev"; then
  2853. prev=
  2854. else
  2855. dest="$arg"
  2856. continue
  2857. fi
  2858. ;;
  2859. esac
  2860. # Aesthetically quote the argument.
  2861. arg=`$echo "X$arg" | $Xsed -e "$sed_quote_subst"`
  2862. case "$arg" in
  2863. *[\[\~\#\^\&\*\(\)\{\}\|\;\<\>\?\'\ \ ]*|*]*)
  2864. arg="\"$arg\""
  2865. ;;
  2866. esac
  2867. install_prog="$install_prog $arg"
  2868. done
  2869. if test -z "$install_prog"; then
  2870. $echo "$modename: you must specify an install program" 1>&2
  2871. $echo "$help" 1>&2
  2872. exit 1
  2873. fi
  2874. if test -n "$prev"; then
  2875. $echo "$modename: the \`$prev' option requires an argument" 1>&2
  2876. $echo "$help" 1>&2
  2877. exit 1
  2878. fi
  2879. if test -z "$files"; then
  2880. if test -z "$dest"; then
  2881. $echo "$modename: no file or destination specified" 1>&2
  2882. else
  2883. $echo "$modename: you must specify a destination" 1>&2
  2884. fi
  2885. $echo "$help" 1>&2
  2886. exit 1
  2887. fi
  2888. # Strip any trailing slash from the destination.
  2889. dest=`$echo "X$dest" | $Xsed -e 's%/$%%'`
  2890. # Check to see that the destination is a directory.
  2891. test -d "$dest" && isdir=yes
  2892. if test "$isdir" = yes; then
  2893. destdir="$dest"
  2894. destname=
  2895. else
  2896. destdir=`$echo "X$dest" | $Xsed -e 's%/[^/]*$%%'`
  2897. test "X$destdir" = "X$dest" && destdir=.
  2898. destname=`$echo "X$dest" | $Xsed -e 's%^.*/%%'`
  2899. # Not a directory, so check to see that there is only one file specified.
  2900. set dummy $files
  2901. if test $# -gt 2; then
  2902. $echo "$modename: \`$dest' is not a directory" 1>&2
  2903. $echo "$help" 1>&2
  2904. exit 1
  2905. fi
  2906. fi
  2907. case "$destdir" in
  2908. [\\/]* | [A-Za-z]:[\\/]*) ;;
  2909. *)
  2910. for file in $files; do
  2911. case "$file" in
  2912. *.lo) ;;
  2913. *)
  2914. $echo "$modename: \`$destdir' must be an absolute directory name" 1>&2
  2915. $echo "$help" 1>&2
  2916. exit 1
  2917. ;;
  2918. esac
  2919. done
  2920. ;;
  2921. esac
  2922. # This variable tells wrapper scripts just to set variables rather
  2923. # than running their programs.
  2924. libtool_install_magic="$magic"
  2925. staticlibs=
  2926. future_libdirs=
  2927. current_libdirs=
  2928. for file in $files; do
  2929. # Do each installation.
  2930. case "$file" in
  2931. *.a | *.lib)
  2932. # Do the static libraries later.
  2933. staticlibs="$staticlibs $file"
  2934. ;;
  2935. *.la)
  2936. # Check to see that this really is a libtool archive.
  2937. if (sed -e '2q' $file | egrep "^# Generated by .*$PACKAGE") >/dev/null 2>&1; then :
  2938. else
  2939. $echo "$modename: \`$file' is not a valid libtool archive" 1>&2
  2940. $echo "$help" 1>&2
  2941. exit 1
  2942. fi
  2943. library_names=
  2944. old_library=
  2945. # If there is no directory component, then add one.
  2946. case "$file" in
  2947. */* | *\\*) . $file ;;
  2948. *) . ./$file ;;
  2949. esac
  2950. # Add the libdir to current_libdirs if it is the destination.
  2951. if test "X$destdir" = "X$libdir"; then
  2952. case "$current_libdirs " in
  2953. *" $libdir "*) ;;
  2954. *) current_libdirs="$current_libdirs $libdir" ;;
  2955. esac
  2956. else
  2957. # Note the libdir as a future libdir.
  2958. case "$future_libdirs " in
  2959. *" $libdir "*) ;;
  2960. *) future_libdirs="$future_libdirs $libdir" ;;
  2961. esac
  2962. fi
  2963. dir="`$echo "X$file" | $Xsed -e 's%/[^/]*$%%'`/"
  2964. test "X$dir" = "X$file/" && dir=
  2965. dir="$dir$objdir"
  2966. # See the names of the shared library.
  2967. set dummy $library_names
  2968. if test -n "$2"; then
  2969. realname="$2"
  2970. shift
  2971. shift
  2972. # Install the shared library and build the symlinks.
  2973. $show "$install_prog $dir/$realname $destdir/$realname"
  2974. $run eval "$install_prog $dir/$realname $destdir/$realname" || exit $?
  2975. if test $# -gt 0; then
  2976. # Delete the old symlinks, and create new ones.
  2977. for linkname
  2978. do
  2979. if test "$linkname" != "$realname"; then
  2980. $show "(cd $destdir && $rm $linkname && $LN_S $realname $linkname)"
  2981. $run eval "(cd $destdir && $rm $linkname && $LN_S $realname $linkname)"
  2982. fi
  2983. done
  2984. fi
  2985. # Do each command in the postinstall commands.
  2986. lib="$destdir/$realname"
  2987. eval cmds=\"$postinstall_cmds\"
  2988. IFS="${IFS= }"; save_ifs="$IFS"; IFS='~'
  2989. for cmd in $cmds; do
  2990. IFS="$save_ifs"
  2991. $show "$cmd"
  2992. $run eval "$cmd" || exit $?
  2993. done
  2994. IFS="$save_ifs"
  2995. fi
  2996. # Install the pseudo-library for information purposes.
  2997. name=`$echo "X$file" | $Xsed -e 's%^.*/%%'`
  2998. instname="$dir/$name"i
  2999. $show "$install_prog $instname $destdir/$name"
  3000. $run eval "$install_prog $instname $destdir/$name" || exit $?
  3001. # Maybe install the static library, too.
  3002. test -n "$old_library" && staticlibs="$staticlibs $dir/$old_library"
  3003. ;;
  3004. *.lo)
  3005. # Install (i.e. copy) a libtool object.
  3006. # Figure out destination file name, if it wasn't already specified.
  3007. if test -n "$destname"; then
  3008. destfile="$destdir/$destname"
  3009. else
  3010. destfile=`$echo "X$file" | $Xsed -e 's%^.*/%%'`
  3011. destfile="$destdir/$destfile"
  3012. fi
  3013. # Deduce the name of the destination old-style object file.
  3014. case "$destfile" in
  3015. *.lo)
  3016. staticdest=`$echo "X$destfile" | $Xsed -e "$lo2o"`
  3017. ;;
  3018. *.o | *.obj)
  3019. staticdest="$destfile"
  3020. destfile=
  3021. ;;
  3022. *)
  3023. $echo "$modename: cannot copy a libtool object to \`$destfile'" 1>&2
  3024. $echo "$help" 1>&2
  3025. exit 1
  3026. ;;
  3027. esac
  3028. # Install the libtool object if requested.
  3029. if test -n "$destfile"; then
  3030. $show "$install_prog $file $destfile"
  3031. $run eval "$install_prog $file $destfile" || exit $?
  3032. fi
  3033. # Install the old object if enabled.
  3034. if test "$build_old_libs" = yes; then
  3035. # Deduce the name of the old-style object file.
  3036. staticobj=`$echo "X$file" | $Xsed -e "$lo2o"`
  3037. $show "$install_prog $staticobj $staticdest"
  3038. $run eval "$install_prog \$staticobj \$staticdest" || exit $?
  3039. fi
  3040. exit 0
  3041. ;;
  3042. *)
  3043. # Figure out destination file name, if it wasn't already specified.
  3044. if test -n "$destname"; then
  3045. destfile="$destdir/$destname"
  3046. else
  3047. destfile=`$echo "X$file" | $Xsed -e 's%^.*/%%'`
  3048. destfile="$destdir/$destfile"
  3049. fi
  3050. # Do a test to see if this is really a libtool program.
  3051. if (sed -e '4q' $file | egrep "^# Generated by .*$PACKAGE") >/dev/null 2>&1; then
  3052. link_against_libtool_libs=
  3053. relink_command=
  3054. # If there is no directory component, then add one.
  3055. case "$file" in
  3056. */* | *\\*) . $file ;;
  3057. *) . ./$file ;;
  3058. esac
  3059. # Check the variables that should have been set.
  3060. if test -z "$link_against_libtool_libs"; then
  3061. $echo "$modename: invalid libtool wrapper script \`$file'" 1>&2
  3062. exit 1
  3063. fi
  3064. finalize=yes
  3065. for lib in $link_against_libtool_libs; do
  3066. # Check to see that each library is installed.
  3067. libdir=
  3068. if test -f "$lib"; then
  3069. # If there is no directory component, then add one.
  3070. case "$lib" in
  3071. */* | *\\*) . $lib ;;
  3072. *) . ./$lib ;;
  3073. esac
  3074. fi
  3075. libfile="$libdir/`$echo "X$lib" | $Xsed -e 's%^.*/%%g'`"
  3076. if test -n "$libdir" && test ! -f "$libfile"; then
  3077. $echo "$modename: warning: \`$lib' has not been installed in \`$libdir'" 1>&2
  3078. finalize=no
  3079. fi
  3080. done
  3081. outputname=
  3082. if test "$fast_install" = no && test -n "$relink_command"; then
  3083. if test "$finalize" = yes && test -z "$run"; then
  3084. tmpdir="/tmp"
  3085. test -n "$TMPDIR" && tmpdir="$TMPDIR"
  3086. tmpdir="$tmpdir/libtool-$$"
  3087. if $mkdir -p "$tmpdir" && chmod 700 "$tmpdir"; then :
  3088. else
  3089. $echo "$modename: error: cannot create temporary directory \`$tmpdir'" 1>&2
  3090. continue
  3091. fi
  3092. outputname="$tmpdir/$file"
  3093. # Replace the output file specification.
  3094. relink_command=`$echo "X$relink_command" | $Xsed -e 's%@OUTPUT@%'"$outputname"'%g'`
  3095. $show "$relink_command"
  3096. if $run eval "$relink_command"; then :
  3097. else
  3098. $echo "$modename: error: relink \`$file' with the above command before installing it" 1>&2
  3099. ${rm}r "$tmpdir"
  3100. continue
  3101. fi
  3102. file="$outputname"
  3103. else
  3104. $echo "$modename: warning: cannot relink \`$file'" 1>&2
  3105. fi
  3106. else
  3107. # Install the binary that we compiled earlier.
  3108. file=`$echo "X$file" | $Xsed -e "s%\([^/]*\)$%$objdir/\1%"`
  3109. fi
  3110. fi
  3111. $show "$install_prog$stripme $file $destfile"
  3112. $run eval "$install_prog\$stripme \$file \$destfile" || exit $?
  3113. test -n "$outputname" && ${rm}r "$tmpdir"
  3114. ;;
  3115. esac
  3116. done
  3117. for file in $staticlibs; do
  3118. name=`$echo "X$file" | $Xsed -e 's%^.*/%%'`
  3119. # Set up the ranlib parameters.
  3120. oldlib="$destdir/$name"
  3121. $show "$install_prog $file $oldlib"
  3122. $run eval "$install_prog \$file \$oldlib" || exit $?
  3123. # Do each command in the postinstall commands.
  3124. eval cmds=\"$old_postinstall_cmds\"
  3125. IFS="${IFS= }"; save_ifs="$IFS"; IFS='~'
  3126. for cmd in $cmds; do
  3127. IFS="$save_ifs"
  3128. $show "$cmd"
  3129. $run eval "$cmd" || exit $?
  3130. done
  3131. IFS="$save_ifs"
  3132. done
  3133. if test -n "$future_libdirs"; then
  3134. $echo "$modename: warning: remember to run \`$progname --finish$future_libdirs'" 1>&2
  3135. fi
  3136. if test -n "$current_libdirs"; then
  3137. # Maybe just do a dry run.
  3138. test -n "$run" && current_libdirs=" -n$current_libdirs"
  3139. exec $SHELL $0 --finish$current_libdirs
  3140. exit 1
  3141. fi
  3142. exit 0
  3143. ;;
  3144. # libtool finish mode
  3145. finish)
  3146. modename="$modename: finish"
  3147. libdirs="$nonopt"
  3148. admincmds=
  3149. if test -n "$finish_cmds$finish_eval" && test -n "$libdirs"; then
  3150. for dir
  3151. do
  3152. libdirs="$libdirs $dir"
  3153. done
  3154. for libdir in $libdirs; do
  3155. if test -n "$finish_cmds"; then
  3156. # Do each command in the finish commands.
  3157. eval cmds=\"$finish_cmds\"
  3158. IFS="${IFS= }"; save_ifs="$IFS"; IFS='~'
  3159. for cmd in $cmds; do
  3160. IFS="$save_ifs"
  3161. $show "$cmd"
  3162. $run eval "$cmd" || admincmds="$admincmds
  3163. $cmd"
  3164. done
  3165. IFS="$save_ifs"
  3166. fi
  3167. if test -n "$finish_eval"; then
  3168. # Do the single finish_eval.
  3169. eval cmds=\"$finish_eval\"
  3170. $run eval "$cmds" || admincmds="$admincmds
  3171. $cmds"
  3172. fi
  3173. done
  3174. fi
  3175. # Exit here if they wanted silent mode.
  3176. test "$show" = : && exit 0
  3177. echo "----------------------------------------------------------------------"
  3178. echo "Libraries have been installed in:"
  3179. for libdir in $libdirs; do
  3180. echo " $libdir"
  3181. done
  3182. echo
  3183. echo "If you ever happen to want to link against installed libraries"
  3184. echo "in a given directory, LIBDIR, you must either use libtool, and"
  3185. echo "specify the full pathname of the library, or use \`-LLIBDIR'"
  3186. echo "flag during linking and do at least one of the following:"
  3187. if test -n "$shlibpath_var"; then
  3188. echo " - add LIBDIR to the \`$shlibpath_var' environment variable"
  3189. echo " during execution"
  3190. fi
  3191. if test -n "$runpath_var"; then
  3192. echo " - add LIBDIR to the \`$runpath_var' environment variable"
  3193. echo " during linking"
  3194. fi
  3195. if test -n "$hardcode_libdir_flag_spec"; then
  3196. libdir=LIBDIR
  3197. eval flag=\"$hardcode_libdir_flag_spec\"
  3198. echo " - use the \`$flag' linker flag"
  3199. fi
  3200. if test -n "$admincmds"; then
  3201. echo " - have your system administrator run these commands:$admincmds"
  3202. fi
  3203. if test -f /etc/ld.so.conf; then
  3204. echo " - have your system administrator add LIBDIR to \`/etc/ld.so.conf'"
  3205. fi
  3206. echo
  3207. echo "See any operating system documentation about shared libraries for"
  3208. echo "more information, such as the ld(1) and ld.so(8) manual pages."
  3209. echo "----------------------------------------------------------------------"
  3210. exit 0
  3211. ;;
  3212. # libtool execute mode
  3213. execute)
  3214. modename="$modename: execute"
  3215. # The first argument is the command name.
  3216. cmd="$nonopt"
  3217. if test -z "$cmd"; then
  3218. $echo "$modename: you must specify a COMMAND" 1>&2
  3219. $echo "$help"
  3220. exit 1
  3221. fi
  3222. # Handle -dlopen flags immediately.
  3223. for file in $execute_dlfiles; do
  3224. if test ! -f "$file"; then
  3225. $echo "$modename: \`$file' is not a file" 1>&2
  3226. $echo "$help" 1>&2
  3227. exit 1
  3228. fi
  3229. dir=
  3230. case "$file" in
  3231. *.la)
  3232. # Check to see that this really is a libtool archive.
  3233. if (sed -e '2q' $file | egrep "^# Generated by .*$PACKAGE") >/dev/null 2>&1; then :
  3234. else
  3235. $echo "$modename: \`$lib' is not a valid libtool archive" 1>&2
  3236. $echo "$help" 1>&2
  3237. exit 1
  3238. fi
  3239. # Read the libtool library.
  3240. dlname=
  3241. library_names=
  3242. # If there is no directory component, then add one.
  3243. case "$file" in
  3244. */* | *\\*) . $file ;;
  3245. *) . ./$file ;;
  3246. esac
  3247. # Skip this library if it cannot be dlopened.
  3248. if test -z "$dlname"; then
  3249. # Warn if it was a shared library.
  3250. test -n "$library_names" && $echo "$modename: warning: \`$file' was not linked with \`-export-dynamic'"
  3251. continue
  3252. fi
  3253. dir=`$echo "X$file" | $Xsed -e 's%/[^/]*$%%'`
  3254. test "X$dir" = "X$file" && dir=.
  3255. if test -f "$dir/$objdir/$dlname"; then
  3256. dir="$dir/$objdir"
  3257. else
  3258. $echo "$modename: cannot find \`$dlname' in \`$dir' or \`$dir/$objdir'" 1>&2
  3259. exit 1
  3260. fi
  3261. ;;
  3262. *.lo)
  3263. # Just add the directory containing the .lo file.
  3264. dir=`$echo "X$file" | $Xsed -e 's%/[^/]*$%%'`
  3265. test "X$dir" = "X$file" && dir=.
  3266. ;;
  3267. *)
  3268. $echo "$modename: warning \`-dlopen' is ignored for non-libtool libraries and objects" 1>&2
  3269. continue
  3270. ;;
  3271. esac
  3272. # Get the absolute pathname.
  3273. absdir=`cd "$dir" && pwd`
  3274. test -n "$absdir" && dir="$absdir"
  3275. # Now add the directory to shlibpath_var.
  3276. if eval "test -z \"\$$shlibpath_var\""; then
  3277. eval "$shlibpath_var=\"\$dir\""
  3278. else
  3279. eval "$shlibpath_var=\"\$dir:\$$shlibpath_var\""
  3280. fi
  3281. done
  3282. # This variable tells wrapper scripts just to set shlibpath_var
  3283. # rather than running their programs.
  3284. libtool_execute_magic="$magic"
  3285. # Check if any of the arguments is a wrapper script.
  3286. args=
  3287. for file
  3288. do
  3289. case "$file" in
  3290. -*) ;;
  3291. *)
  3292. # Do a test to see if this is really a libtool program.
  3293. if (sed -e '4q' $file | egrep "^# Generated by .*$PACKAGE") >/dev/null 2>&1; then
  3294. # If there is no directory component, then add one.
  3295. case "$file" in
  3296. */* | *\\*) . $file ;;
  3297. *) . ./$file ;;
  3298. esac
  3299. # Transform arg to wrapped name.
  3300. file="$progdir/$program"
  3301. fi
  3302. ;;
  3303. esac
  3304. # Quote arguments (to preserve shell metacharacters).
  3305. file=`$echo "X$file" | $Xsed -e "$sed_quote_subst"`
  3306. args="$args \"$file\""
  3307. done
  3308. if test -z "$run"; then
  3309. if test -n "$shlibpath_var"; then
  3310. # Export the shlibpath_var.
  3311. eval "export $shlibpath_var"
  3312. fi
  3313. # Restore saved enviroment variables
  3314. if test "${save_LC_ALL+set}" = set; then
  3315. LC_ALL="$save_LC_ALL"; export LC_ALL
  3316. fi
  3317. if test "${save_LANG+set}" = set; then
  3318. LANG="$save_LANG"; export LANG
  3319. fi
  3320. # Now actually exec the command.
  3321. eval "exec \$cmd$args"
  3322. $echo "$modename: cannot exec \$cmd$args"
  3323. exit 1
  3324. else
  3325. # Display what would be done.
  3326. if test -n "$shlibpath_var"; then
  3327. eval "\$echo \"\$shlibpath_var=\$$shlibpath_var\""
  3328. $echo "export $shlibpath_var"
  3329. fi
  3330. $echo "$cmd$args"
  3331. exit 0
  3332. fi
  3333. ;;
  3334. # libtool uninstall mode
  3335. uninstall)
  3336. modename="$modename: uninstall"
  3337. rm="$nonopt"
  3338. files=
  3339. for arg
  3340. do
  3341. case "$arg" in
  3342. -*) rm="$rm $arg" ;;
  3343. *) files="$files $arg" ;;
  3344. esac
  3345. done
  3346. if test -z "$rm"; then
  3347. $echo "$modename: you must specify an RM program" 1>&2
  3348. $echo "$help" 1>&2
  3349. exit 1
  3350. fi
  3351. for file in $files; do
  3352. dir=`$echo "X$file" | $Xsed -e 's%/[^/]*$%%'`
  3353. test "X$dir" = "X$file" && dir=.
  3354. name=`$echo "X$file" | $Xsed -e 's%^.*/%%'`
  3355. rmfiles="$file"
  3356. case "$name" in
  3357. *.la)
  3358. # Possibly a libtool archive, so verify it.
  3359. if (sed -e '2q' $file | egrep "^# Generated by .*$PACKAGE") >/dev/null 2>&1; then
  3360. . $dir/$name
  3361. # Delete the libtool libraries and symlinks.
  3362. for n in $library_names; do
  3363. rmfiles="$rmfiles $dir/$n"
  3364. done
  3365. test -n "$old_library" && rmfiles="$rmfiles $dir/$old_library"
  3366. $show "$rm $rmfiles"
  3367. $run $rm $rmfiles
  3368. if test -n "$library_names"; then
  3369. # Do each command in the postuninstall commands.
  3370. eval cmds=\"$postuninstall_cmds\"
  3371. IFS="${IFS= }"; save_ifs="$IFS"; IFS='~'
  3372. for cmd in $cmds; do
  3373. IFS="$save_ifs"
  3374. $show "$cmd"
  3375. $run eval "$cmd"
  3376. done
  3377. IFS="$save_ifs"
  3378. fi
  3379. if test -n "$old_library"; then
  3380. # Do each command in the old_postuninstall commands.
  3381. eval cmds=\"$old_postuninstall_cmds\"
  3382. IFS="${IFS= }"; save_ifs="$IFS"; IFS='~'
  3383. for cmd in $cmds; do
  3384. IFS="$save_ifs"
  3385. $show "$cmd"
  3386. $run eval "$cmd"
  3387. done
  3388. IFS="$save_ifs"
  3389. fi
  3390. # FIXME: should reinstall the best remaining shared library.
  3391. fi
  3392. ;;
  3393. *.lo)
  3394. if test "$build_old_libs" = yes; then
  3395. oldobj=`$echo "X$name" | $Xsed -e "$lo2o"`
  3396. rmfiles="$rmfiles $dir/$oldobj"
  3397. fi
  3398. $show "$rm $rmfiles"
  3399. $run $rm $rmfiles
  3400. ;;
  3401. *)
  3402. $show "$rm $rmfiles"
  3403. $run $rm $rmfiles
  3404. ;;
  3405. esac
  3406. done
  3407. exit 0
  3408. ;;
  3409. "")
  3410. $echo "$modename: you must specify a MODE" 1>&2
  3411. $echo "$generic_help" 1>&2
  3412. exit 1
  3413. ;;
  3414. esac
  3415. $echo "$modename: invalid operation mode \`$mode'" 1>&2
  3416. $echo "$generic_help" 1>&2
  3417. exit 1
  3418. fi # test -z "$show_help"
  3419. # We need to display help for each of the modes.
  3420. case "$mode" in
  3421. "") $echo \
  3422. "Usage: $modename [OPTION]... [MODE-ARG]...
  3423. Provide generalized library-building support services.
  3424. --config show all configuration variables
  3425. --debug enable verbose shell tracing
  3426. -n, --dry-run display commands without modifying any files
  3427. --features display basic configuration information and exit
  3428. --finish same as \`--mode=finish'
  3429. --help display this help message and exit
  3430. --mode=MODE use operation mode MODE [default=inferred from MODE-ARGS]
  3431. --quiet same as \`--silent'
  3432. --silent don't print informational messages
  3433. --version print version information
  3434. MODE must be one of the following:
  3435. compile compile a source file into a libtool object
  3436. execute automatically set library path, then run a program
  3437. finish complete the installation of libtool libraries
  3438. install install libraries or executables
  3439. link create a library or an executable
  3440. uninstall remove libraries from an installed directory
  3441. MODE-ARGS vary depending on the MODE. Try \`$modename --help --mode=MODE' for
  3442. a more detailed description of MODE."
  3443. exit 0
  3444. ;;
  3445. compile)
  3446. $echo \
  3447. "Usage: $modename [OPTION]... --mode=compile COMPILE-COMMAND... SOURCEFILE
  3448. Compile a source file into a libtool library object.
  3449. This mode accepts the following additional options:
  3450. -o OUTPUT-FILE set the output file name to OUTPUT-FILE
  3451. -static always build a \`.o' file suitable for static linking
  3452. COMPILE-COMMAND is a command to be used in creating a \`standard' object file
  3453. from the given SOURCEFILE.
  3454. The output file name is determined by removing the directory component from
  3455. SOURCEFILE, then substituting the C source code suffix \`.c' with the
  3456. library object suffix, \`.lo'."
  3457. ;;
  3458. execute)
  3459. $echo \
  3460. "Usage: $modename [OPTION]... --mode=execute COMMAND [ARGS]...
  3461. Automatically set library path, then run a program.
  3462. This mode accepts the following additional options:
  3463. -dlopen FILE add the directory containing FILE to the library path
  3464. This mode sets the library path environment variable according to \`-dlopen'
  3465. flags.
  3466. If any of the ARGS are libtool executable wrappers, then they are translated
  3467. into their corresponding uninstalled binary, and any of their required library
  3468. directories are added to the library path.
  3469. Then, COMMAND is executed, with ARGS as arguments."
  3470. ;;
  3471. finish)
  3472. $echo \
  3473. "Usage: $modename [OPTION]... --mode=finish [LIBDIR]...
  3474. Complete the installation of libtool libraries.
  3475. Each LIBDIR is a directory that contains libtool libraries.
  3476. The commands that this mode executes may require superuser privileges. Use
  3477. the \`--dry-run' option if you just want to see what would be executed."
  3478. ;;
  3479. install)
  3480. $echo \
  3481. "Usage: $modename [OPTION]... --mode=install INSTALL-COMMAND...
  3482. Install executables or libraries.
  3483. INSTALL-COMMAND is the installation command. The first component should be
  3484. either the \`install' or \`cp' program.
  3485. The rest of the components are interpreted as arguments to that command (only
  3486. BSD-compatible install options are recognized)."
  3487. ;;
  3488. link)
  3489. $echo \
  3490. "Usage: $modename [OPTION]... --mode=link LINK-COMMAND...
  3491. Link object files or libraries together to form another library, or to
  3492. create an executable program.
  3493. LINK-COMMAND is a command using the C compiler that you would use to create
  3494. a program from several object files.
  3495. The following components of LINK-COMMAND are treated specially:
  3496. -all-static do not do any dynamic linking at all
  3497. -avoid-version do not add a version suffix if possible
  3498. -dlopen FILE \`-dlpreopen' FILE if it cannot be dlopened at runtime
  3499. -dlpreopen FILE link in FILE and add its symbols to lt_preloaded_symbols
  3500. -export-dynamic allow symbols from OUTPUT-FILE to be resolved with dlsym(3)
  3501. -export-symbols SYMFILE
  3502. try to export only the symbols listed in SYMFILE
  3503. -export-symbols-regex REGEX
  3504. try to export only the symbols matching REGEX
  3505. -LLIBDIR search LIBDIR for required installed libraries
  3506. -lNAME OUTPUT-FILE requires the installed library libNAME
  3507. -module build a library that can dlopened
  3508. -no-undefined declare that a library does not refer to external symbols
  3509. -o OUTPUT-FILE create OUTPUT-FILE from the specified objects
  3510. -release RELEASE specify package release information
  3511. -rpath LIBDIR the created library will eventually be installed in LIBDIR
  3512. -R[ ]LIBDIR add LIBDIR to the runtime path of programs and libraries
  3513. -static do not do any dynamic linking of libtool libraries
  3514. -version-info CURRENT[:REVISION[:AGE]]
  3515. specify library version info [each variable defaults to 0]
  3516. All other options (arguments beginning with \`-') are ignored.
  3517. Every other argument is treated as a filename. Files ending in \`.la' are
  3518. treated as uninstalled libtool libraries, other files are standard or library
  3519. object files.
  3520. If the OUTPUT-FILE ends in \`.la', then a libtool library is created,
  3521. only library objects (\`.lo' files) may be specified, and \`-rpath' is
  3522. required, except when creating a convenience library.
  3523. If OUTPUT-FILE ends in \`.a' or \`.lib', then a standard library is created
  3524. using \`ar' and \`ranlib', or on Windows using \`lib'.
  3525. If OUTPUT-FILE ends in \`.lo' or \`.${objext}', then a reloadable object file
  3526. is created, otherwise an executable program is created."
  3527. ;;
  3528. uninstall)
  3529. $echo \
  3530. "Usage: $modename [OPTION]... --mode=uninstall RM [RM-OPTION]... FILE...
  3531. Remove libraries from an installation directory.
  3532. RM is the name of the program to use to delete files associated with each FILE
  3533. (typically \`/bin/rm'). RM-OPTIONS are options (such as \`-f') to be passed
  3534. to RM.
  3535. If FILE is a libtool library, all the files associated with it are deleted.
  3536. Otherwise, only FILE itself is deleted using RM."
  3537. ;;
  3538. *)
  3539. $echo "$modename: invalid operation mode \`$mode'" 1>&2
  3540. $echo "$help" 1>&2
  3541. exit 1
  3542. ;;
  3543. esac
  3544. echo
  3545. $echo "Try \`$modename --help' for more information about other modes."
  3546. exit 0
  3547. # Local Variables:
  3548. # mode:shell-script
  3549. # sh-indentation:2
  3550. # End: