PageRenderTime 85ms CodeModel.GetById 22ms RepoModel.GetById 0ms app.codeStats 1ms

/ltmain.sh

http://github.com/dreamcat4/php-fpm
Shell | 6460 lines | 5493 code | 413 blank | 554 comment | 625 complexity | cf171fa84cef17c837fe32b8945250bf MD5 | raw file
  1. # ltmain.sh - Provide generalized library-building support services.
  2. # NOTE: Changing this file will not affect anything until you rerun configure.
  3. #
  4. # Copyright (C) 1996, 1997, 1998, 1999, 2000, 2001, 2003, 2004, 2005
  5. # Free Software Foundation, Inc.
  6. # Originally by Gordon Matzigkeit <gord@gnu.ai.mit.edu>, 1996
  7. #
  8. # This program is free software; you can redistribute it and/or modify
  9. # it under the terms of the GNU General Public License as published by
  10. # the Free Software Foundation; either version 2 of the License, or
  11. # (at your option) any later version.
  12. #
  13. # This program is distributed in the hope that it will be useful, but
  14. # WITHOUT ANY WARRANTY; without even the implied warranty of
  15. # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
  16. # General Public License for more details.
  17. #
  18. # You should have received a copy of the GNU General Public License
  19. # along with this program; if not, write to the Free Software
  20. # Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
  21. #
  22. # As a special exception to the GNU General Public License, if you
  23. # distribute this file as part of a program that contains a
  24. # configuration script generated by Autoconf, you may include it under
  25. # the same distribution terms that you use for the rest of that program.
  26. basename="s,^.*/,,g"
  27. # Work around backward compatibility issue on IRIX 6.5. On IRIX 6.4+, sh
  28. # is ksh but when the shell is invoked as "sh" and the current value of
  29. # the _XPG environment variable is not equal to 1 (one), the special
  30. # positional parameter $0, within a function call, is the name of the
  31. # function.
  32. progpath="$0"
  33. # The name of this program:
  34. progname=`echo "$progpath" | $SED $basename`
  35. modename="$progname"
  36. # Global variables:
  37. EXIT_SUCCESS=0
  38. EXIT_FAILURE=1
  39. PROGRAM=ltmain.sh
  40. PACKAGE=libtool
  41. VERSION=1.5.14
  42. TIMESTAMP=" (1.1220.2.195 2005/02/12 12:12:33)"
  43. # See if we are running on zsh, and set the options which allow our
  44. # commands through without removal of \ escapes.
  45. if test -n "${ZSH_VERSION+set}" ; then
  46. setopt NO_GLOB_SUBST
  47. fi
  48. # Check that we have a working $echo.
  49. if test "X$1" = X--no-reexec; then
  50. # Discard the --no-reexec flag, and continue.
  51. shift
  52. elif test "X$1" = X--fallback-echo; then
  53. # Avoid inline document here, it may be left over
  54. :
  55. elif test "X`($echo '\t') 2>/dev/null`" = 'X\t'; then
  56. # Yippee, $echo works!
  57. :
  58. else
  59. # Restart under the correct shell, and then maybe $echo will work.
  60. exec $SHELL "$progpath" --no-reexec ${1+"$@"}
  61. fi
  62. if test "X$1" = X--fallback-echo; then
  63. # used as fallback echo
  64. shift
  65. cat <<EOF
  66. $*
  67. EOF
  68. exit $EXIT_SUCCESS
  69. fi
  70. default_mode=
  71. help="Try \`$progname --help' for more information."
  72. magic="%%%MAGIC variable%%%"
  73. mkdir="mkdir"
  74. mv="mv -f"
  75. rm="rm -f"
  76. # Sed substitution that helps us do robust quoting. It backslashifies
  77. # metacharacters that are still active within double-quoted strings.
  78. Xsed="${SED}"' -e 1s/^X//'
  79. sed_quote_subst='s/\([\\`\\"$\\\\]\)/\\\1/g'
  80. # test EBCDIC or ASCII
  81. case `echo A|tr A '\301'` in
  82. A) # EBCDIC based system
  83. SP2NL="tr '\100' '\n'"
  84. NL2SP="tr '\r\n' '\100\100'"
  85. ;;
  86. *) # Assume ASCII based system
  87. SP2NL="tr '\040' '\012'"
  88. NL2SP="tr '\015\012' '\040\040'"
  89. ;;
  90. esac
  91. # NLS nuisances.
  92. # Only set LANG and LC_ALL to C if already set.
  93. # These must not be set unconditionally because not all systems understand
  94. # e.g. LANG=C (notably SCO).
  95. # We save the old values to restore during execute mode.
  96. if test "${LC_ALL+set}" = set; then
  97. save_LC_ALL="$LC_ALL"; LC_ALL=C; export LC_ALL
  98. fi
  99. if test "${LANG+set}" = set; then
  100. save_LANG="$LANG"; LANG=C; export LANG
  101. fi
  102. # Make sure IFS has a sensible default
  103. : ${IFS="
  104. "}
  105. if test "$build_libtool_libs" != yes && test "$build_old_libs" != yes; then
  106. $echo "$modename: not configured to build any kind of library" 1>&2
  107. $echo "Fatal configuration error. See the $PACKAGE docs for more information." 1>&2
  108. exit $EXIT_FAILURE
  109. fi
  110. # Global variables.
  111. mode=$default_mode
  112. nonopt=
  113. prev=
  114. prevopt=
  115. run=
  116. show="$echo"
  117. show_help=
  118. execute_dlfiles=
  119. lo2o="s/\\.lo\$/.${objext}/"
  120. o2lo="s/\\.${objext}\$/.lo/"
  121. quote_scanset='[[~#^*{};<>?'"'"' ]'
  122. #####################################
  123. # Shell function definitions:
  124. # This seems to be the best place for them
  125. # func_win32_libid arg
  126. # return the library type of file 'arg'
  127. #
  128. # Need a lot of goo to handle *both* DLLs and import libs
  129. # Has to be a shell function in order to 'eat' the argument
  130. # that is supplied when $file_magic_command is called.
  131. func_win32_libid ()
  132. {
  133. win32_libid_type="unknown"
  134. win32_fileres=`file -L $1 2>/dev/null`
  135. case $win32_fileres in
  136. *ar\ archive\ import\ library*) # definitely import
  137. win32_libid_type="x86 archive import"
  138. ;;
  139. *ar\ archive*) # could be an import, or static
  140. if eval $OBJDUMP -f $1 | $SED -e '10q' 2>/dev/null | \
  141. $EGREP -e 'file format pe-i386(.*architecture: i386)?' >/dev/null ; then
  142. win32_nmres=`eval $NM -f posix -A $1 | \
  143. sed -n -e '1,100{/ I /{x;/import/!{s/^/import/;h;p;};x;};}'`
  144. if test "X$win32_nmres" = "Ximport" ; then
  145. win32_libid_type="x86 archive import"
  146. else
  147. win32_libid_type="x86 archive static"
  148. fi
  149. fi
  150. ;;
  151. *DLL*)
  152. win32_libid_type="x86 DLL"
  153. ;;
  154. *executable*) # but shell scripts are "executable" too...
  155. case $win32_fileres in
  156. *MS\ Windows\ PE\ Intel*)
  157. win32_libid_type="x86 DLL"
  158. ;;
  159. esac
  160. ;;
  161. esac
  162. $echo $win32_libid_type
  163. }
  164. # func_infer_tag arg
  165. # Infer tagged configuration to use if any are available and
  166. # if one wasn't chosen via the "--tag" command line option.
  167. # Only attempt this if the compiler in the base compile
  168. # command doesn't match the default compiler.
  169. # arg is usually of the form 'gcc ...'
  170. func_infer_tag ()
  171. {
  172. if test -n "$available_tags" && test -z "$tagname"; then
  173. CC_quoted=
  174. for arg in $CC; do
  175. case $arg in
  176. *$quote_scanset* | *]* | *\|* | *\&* | *\(* | *\)* | "")
  177. arg="\"$arg\""
  178. ;;
  179. esac
  180. CC_quoted="$CC_quoted $arg"
  181. done
  182. case $@ in
  183. # Blanks in the command may have been stripped by the calling shell,
  184. # but not from the CC environment variable when configure was run.
  185. " $CC "* | "$CC "* | " `$echo $CC` "* | "`$echo $CC` "* | " $CC_quoted"* | "$CC_quoted "* | " `$echo $CC_quoted` "* | "`$echo $CC_quoted` "*) ;;
  186. # Blanks at the start of $base_compile will cause this to fail
  187. # if we don't check for them as well.
  188. *)
  189. for z in $available_tags; do
  190. if grep "^# ### BEGIN LIBTOOL TAG CONFIG: $z$" < "$progpath" > /dev/null; then
  191. # Evaluate the configuration.
  192. eval "`${SED} -n -e '/^# ### BEGIN LIBTOOL TAG CONFIG: '$z'$/,/^# ### END LIBTOOL TAG CONFIG: '$z'$/p' < $progpath`"
  193. CC_quoted=
  194. for arg in $CC; do
  195. # Double-quote args containing other shell metacharacters.
  196. case $arg in
  197. *$quote_scanset* | *]* | *\|* | *\&* | *\(* | *\)* | "")
  198. arg="\"$arg\""
  199. ;;
  200. esac
  201. CC_quoted="$CC_quoted $arg"
  202. done
  203. case "$@ " in
  204. " $CC "* | "$CC "* | " `$echo $CC` "* | "`$echo $CC` "* | " $CC_quoted"* | "$CC_quoted "* | " `$echo $CC_quoted` "* | "`$echo $CC_quoted` "*)
  205. # The compiler in the base compile command matches
  206. # the one in the tagged configuration.
  207. # Assume this is the tagged configuration we want.
  208. tagname=$z
  209. break
  210. ;;
  211. esac
  212. fi
  213. done
  214. # If $tagname still isn't set, then no tagged configuration
  215. # was found and let the user know that the "--tag" command
  216. # line option must be used.
  217. if test -z "$tagname"; then
  218. $echo "$modename: unable to infer tagged configuration"
  219. $echo "$modename: specify a tag with \`--tag'" 1>&2
  220. exit $EXIT_FAILURE
  221. # else
  222. # $echo "$modename: using $tagname tagged configuration"
  223. fi
  224. ;;
  225. esac
  226. fi
  227. }
  228. # func_extract_an_archive dir oldlib
  229. func_extract_an_archive ()
  230. {
  231. f_ex_an_ar_dir="$1"; shift
  232. f_ex_an_ar_oldlib="$1"
  233. f_ex_an_ar_lib=`$echo "X$f_ex_an_ar_oldlib" | $Xsed -e 's%^.*/%%'`
  234. $show "(cd $f_ex_an_ar_dir && $AR x $f_ex_an_ar_oldlib)"
  235. $run eval "(cd \$f_ex_an_ar_dir && $AR x \$f_ex_an_ar_oldlib)" || exit $?
  236. if ($AR t "$f_ex_an_ar_oldlib" | sort | sort -uc >/dev/null 2>&1); then
  237. :
  238. else
  239. $echo "$modename: warning: object name conflicts; renaming object files" 1>&2
  240. $echo "$modename: warning: to ensure that they will not overwrite" 1>&2
  241. $show "cp $f_ex_an_ar_oldlib $f_ex_an_ar_dir/$f_ex_an_ar_lib"
  242. $run eval "cp \$f_ex_an_ar_oldlib \$f_ex_an_ar_dir/\$f_ex_an_ar_lib"
  243. $AR t "$f_ex_an_ar_oldlib" | sort | uniq -c \
  244. | $EGREP -v '^[ ]*1[ ]' | while read count name
  245. do
  246. i=1
  247. while test "$i" -le "$count"
  248. do
  249. # Put our $i before any first dot (extension)
  250. # Never overwrite any file
  251. name_to="$name"
  252. while test "X$name_to" = "X$name" || test -f "$f_ex_an_ar_dir/$name_to"
  253. do
  254. name_to=`$echo "X$name_to" | $Xsed -e "s/\([^.]*\)/\1-$i/"`
  255. done
  256. $show "(cd $f_ex_an_ar_dir && $AR x $f_ex_an_ar_lib '$name' && $mv '$name' '$name_to')"
  257. $run eval "(cd \$f_ex_an_ar_dir && $AR x \$f_ex_an_ar_lib '$name' && $mv '$name' '$name_to' && $AR -d \$f_ex_an_ar_lib '$name')" || exit $?
  258. i=`expr $i + 1`
  259. done
  260. done
  261. $show "$rm $f_ex_an_ar_dir/$f_ex_an_ar_lib"
  262. $run eval "$rm \$f_ex_an_ar_dir/\$f_ex_an_ar_lib"
  263. fi
  264. }
  265. # func_extract_archives gentop oldlib ...
  266. func_extract_archives ()
  267. {
  268. my_gentop="$1"; shift
  269. my_oldlibs=${1+"$@"}
  270. my_oldobjs=""
  271. my_xlib=""
  272. my_xabs=""
  273. my_xdir=""
  274. my_status=""
  275. $show "${rm}r $my_gentop"
  276. $run ${rm}r "$my_gentop"
  277. $show "$mkdir $my_gentop"
  278. $run $mkdir "$my_gentop"
  279. my_status=$?
  280. if test "$my_status" -ne 0 && test ! -d "$my_gentop"; then
  281. exit $my_status
  282. fi
  283. for my_xlib in $my_oldlibs; do
  284. # Extract the objects.
  285. case $my_xlib in
  286. [\\/]* | [A-Za-z]:[\\/]*) my_xabs="$my_xlib" ;;
  287. *) my_xabs=`pwd`"/$my_xlib" ;;
  288. esac
  289. my_xlib=`$echo "X$my_xlib" | $Xsed -e 's%^.*/%%'`
  290. my_xdir="$my_gentop/$my_xlib"
  291. $show "${rm}r $my_xdir"
  292. $run ${rm}r "$my_xdir"
  293. $show "$mkdir $my_xdir"
  294. $run $mkdir "$my_xdir"
  295. status=$?
  296. if test "$status" -ne 0 && test ! -d "$my_xdir"; then
  297. exit $status
  298. fi
  299. case $host in
  300. *-darwin*)
  301. $show "Extracting $my_xabs"
  302. # Do not bother doing anything if just a dry run
  303. if test -z "$run"; then
  304. darwin_orig_dir=`pwd`
  305. cd $my_xdir || exit $?
  306. darwin_archive=$my_xabs
  307. darwin_curdir=`pwd`
  308. darwin_base_archive=`$echo "X$darwin_archive" | $Xsed -e 's%^.*/%%'`
  309. darwin_arches=`lipo -info "$darwin_archive" 2>/dev/null | $EGREP Architectures 2>/dev/null`
  310. if test -n "$darwin_arches"; then
  311. darwin_arches=`echo "$darwin_arches" | $SED -e 's/.*are://'`
  312. darwin_arch=
  313. $show "$darwin_base_archive has multiple architectures $darwin_arches"
  314. for darwin_arch in $darwin_arches ; do
  315. mkdir -p "unfat-$$/${darwin_base_archive}-${darwin_arch}"
  316. lipo -thin $darwin_arch -output "unfat-$$/${darwin_base_archive}-${darwin_arch}/${darwin_base_archive}" "${darwin_archive}"
  317. cd "unfat-$$/${darwin_base_archive}-${darwin_arch}"
  318. func_extract_an_archive "`pwd`" "${darwin_base_archive}"
  319. cd "$darwin_curdir"
  320. $rm "unfat-$$/${darwin_base_archive}-${darwin_arch}/${darwin_base_archive}"
  321. done # $darwin_arches
  322. ## Okay now we have a bunch of thin objects, gotta fatten them up :)
  323. darwin_filelist=`find unfat-$$ -type f -name \*.o -print -o -name \*.lo -print| xargs basename | sort -u | $NL2SP`
  324. darwin_file=
  325. darwin_files=
  326. for darwin_file in $darwin_filelist; do
  327. darwin_files=`find unfat-$$ -name $darwin_file -print | $NL2SP`
  328. lipo -create -output "$darwin_file" $darwin_files
  329. done # $darwin_filelist
  330. ${rm}r unfat-$$
  331. cd "$darwin_orig_dir"
  332. else
  333. cd "$darwin_orig_dir"
  334. func_extract_an_archive "$my_xdir" "$my_xabs"
  335. fi # $darwin_arches
  336. fi # $run
  337. ;;
  338. *)
  339. func_extract_an_archive "$my_xdir" "$my_xabs"
  340. ;;
  341. esac
  342. my_oldobjs="$my_oldobjs "`find $my_xdir -name \*.$objext -print -o -name \*.lo -print | $NL2SP`
  343. done
  344. func_extract_archives_result="$my_oldobjs"
  345. }
  346. # End of Shell function definitions
  347. #####################################
  348. # Darwin sucks
  349. eval std_shrext=\"$shrext_cmds\"
  350. # Parse our command line options once, thoroughly.
  351. while test "$#" -gt 0
  352. do
  353. arg="$1"
  354. shift
  355. case $arg in
  356. -*=*) optarg=`$echo "X$arg" | $Xsed -e 's/[-_a-zA-Z0-9]*=//'` ;;
  357. *) optarg= ;;
  358. esac
  359. # If the previous option needs an argument, assign it.
  360. if test -n "$prev"; then
  361. case $prev in
  362. execute_dlfiles)
  363. execute_dlfiles="$execute_dlfiles $arg"
  364. ;;
  365. tag)
  366. tagname="$arg"
  367. preserve_args="${preserve_args}=$arg"
  368. # Check whether tagname contains only valid characters
  369. case $tagname in
  370. *[!-_A-Za-z0-9,/]*)
  371. $echo "$progname: invalid tag name: $tagname" 1>&2
  372. exit $EXIT_FAILURE
  373. ;;
  374. esac
  375. case $tagname in
  376. CC)
  377. # Don't test for the "default" C tag, as we know, it's there, but
  378. # not specially marked.
  379. ;;
  380. *)
  381. if grep "^# ### BEGIN LIBTOOL TAG CONFIG: $tagname$" < "$progpath" > /dev/null; then
  382. taglist="$taglist $tagname"
  383. # Evaluate the configuration.
  384. eval "`${SED} -n -e '/^# ### BEGIN LIBTOOL TAG CONFIG: '$tagname'$/,/^# ### END LIBTOOL TAG CONFIG: '$tagname'$/p' < $progpath`"
  385. else
  386. $echo "$progname: ignoring unknown tag $tagname" 1>&2
  387. fi
  388. ;;
  389. esac
  390. ;;
  391. *)
  392. eval "$prev=\$arg"
  393. ;;
  394. esac
  395. prev=
  396. prevopt=
  397. continue
  398. fi
  399. # Have we seen a non-optional argument yet?
  400. case $arg in
  401. --help)
  402. show_help=yes
  403. ;;
  404. --version)
  405. $echo "$PROGRAM (GNU $PACKAGE) $VERSION$TIMESTAMP"
  406. $echo
  407. $echo "Copyright (C) 2005 Free Software Foundation, Inc."
  408. $echo "This is free software; see the source for copying conditions. There is NO"
  409. $echo "warranty; not even for MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE."
  410. exit $?
  411. ;;
  412. --config)
  413. ${SED} -e '1,/^# ### BEGIN LIBTOOL CONFIG/d' -e '/^# ### END LIBTOOL CONFIG/,$d' $progpath
  414. # Now print the configurations for the tags.
  415. for tagname in $taglist; do
  416. ${SED} -n -e "/^# ### BEGIN LIBTOOL TAG CONFIG: $tagname$/,/^# ### END LIBTOOL TAG CONFIG: $tagname$/p" < "$progpath"
  417. done
  418. exit $?
  419. ;;
  420. --debug)
  421. $echo "$progname: enabling shell trace mode"
  422. set -x
  423. preserve_args="$preserve_args $arg"
  424. ;;
  425. --dry-run | -n)
  426. run=:
  427. ;;
  428. --features)
  429. $echo "host: $host"
  430. if test "$build_libtool_libs" = yes; then
  431. $echo "enable shared libraries"
  432. else
  433. $echo "disable shared libraries"
  434. fi
  435. if test "$build_old_libs" = yes; then
  436. $echo "enable static libraries"
  437. else
  438. $echo "disable static libraries"
  439. fi
  440. exit $?
  441. ;;
  442. --finish) mode="finish" ;;
  443. --mode) prevopt="--mode" prev=mode ;;
  444. --mode=*) mode="$optarg" ;;
  445. --preserve-dup-deps) duplicate_deps="yes" ;;
  446. --quiet | --silent)
  447. show=:
  448. preserve_args="$preserve_args $arg"
  449. ;;
  450. --tag) prevopt="--tag" prev=tag ;;
  451. --tag=*)
  452. set tag "$optarg" ${1+"$@"}
  453. shift
  454. prev=tag
  455. preserve_args="$preserve_args --tag"
  456. ;;
  457. -dlopen)
  458. prevopt="-dlopen"
  459. prev=execute_dlfiles
  460. ;;
  461. -*)
  462. $echo "$modename: unrecognized option \`$arg'" 1>&2
  463. $echo "$help" 1>&2
  464. exit $EXIT_FAILURE
  465. ;;
  466. *)
  467. nonopt="$arg"
  468. break
  469. ;;
  470. esac
  471. done
  472. if test -n "$prevopt"; then
  473. $echo "$modename: option \`$prevopt' requires an argument" 1>&2
  474. $echo "$help" 1>&2
  475. exit $EXIT_FAILURE
  476. fi
  477. # If this variable is set in any of the actions, the command in it
  478. # will be execed at the end. This prevents here-documents from being
  479. # left over by shells.
  480. exec_cmd=
  481. if test -z "$show_help"; then
  482. # Infer the operation mode.
  483. if test -z "$mode"; then
  484. $echo "*** Warning: inferring the mode of operation is deprecated." 1>&2
  485. $echo "*** Future versions of Libtool will require --mode=MODE be specified." 1>&2
  486. case $nonopt in
  487. *cc | cc* | *++ | gcc* | *-gcc* | g++* | xlc*)
  488. mode=link
  489. for arg
  490. do
  491. case $arg in
  492. -c)
  493. mode=compile
  494. break
  495. ;;
  496. esac
  497. done
  498. ;;
  499. *db | *dbx | *strace | *truss)
  500. mode=execute
  501. ;;
  502. *install*|cp|mv)
  503. mode=install
  504. ;;
  505. *rm)
  506. mode=uninstall
  507. ;;
  508. *)
  509. # If we have no mode, but dlfiles were specified, then do execute mode.
  510. test -n "$execute_dlfiles" && mode=execute
  511. # Just use the default operation mode.
  512. if test -z "$mode"; then
  513. if test -n "$nonopt"; then
  514. $echo "$modename: warning: cannot infer operation mode from \`$nonopt'" 1>&2
  515. else
  516. $echo "$modename: warning: cannot infer operation mode without MODE-ARGS" 1>&2
  517. fi
  518. fi
  519. ;;
  520. esac
  521. fi
  522. # Only execute mode is allowed to have -dlopen flags.
  523. if test -n "$execute_dlfiles" && test "$mode" != execute; then
  524. $echo "$modename: unrecognized option \`-dlopen'" 1>&2
  525. $echo "$help" 1>&2
  526. exit $EXIT_FAILURE
  527. fi
  528. # Change the help message to a mode-specific one.
  529. generic_help="$help"
  530. help="Try \`$modename --help --mode=$mode' for more information."
  531. # These modes are in order of execution frequency so that they run quickly.
  532. case $mode in
  533. # libtool compile mode
  534. compile)
  535. modename="$modename: compile"
  536. # Get the compilation command and the source file.
  537. base_compile=
  538. srcfile="$nonopt" # always keep a non-empty value in "srcfile"
  539. suppress_opt=yes
  540. suppress_output=
  541. arg_mode=normal
  542. libobj=
  543. later=
  544. for arg
  545. do
  546. case "$arg_mode" in
  547. arg )
  548. # do not "continue". Instead, add this to base_compile
  549. lastarg="$arg"
  550. arg_mode=normal
  551. ;;
  552. target )
  553. libobj="$arg"
  554. arg_mode=normal
  555. continue
  556. ;;
  557. normal )
  558. # Accept any command-line options.
  559. case $arg in
  560. -o)
  561. if test -n "$libobj" ; then
  562. $echo "$modename: you cannot specify \`-o' more than once" 1>&2
  563. exit $EXIT_FAILURE
  564. fi
  565. arg_mode=target
  566. continue
  567. ;;
  568. -static | -prefer-pic | -prefer-non-pic)
  569. later="$later $arg"
  570. continue
  571. ;;
  572. -no-suppress)
  573. suppress_opt=no
  574. continue
  575. ;;
  576. -Xcompiler)
  577. arg_mode=arg # the next one goes into the "base_compile" arg list
  578. continue # The current "srcfile" will either be retained or
  579. ;; # replaced later. I would guess that would be a bug.
  580. -Wc,*)
  581. args=`$echo "X$arg" | $Xsed -e "s/^-Wc,//"`
  582. lastarg=
  583. save_ifs="$IFS"; IFS=','
  584. for arg in $args; do
  585. IFS="$save_ifs"
  586. # Double-quote args containing other shell metacharacters.
  587. # Many Bourne shells cannot handle close brackets correctly
  588. # in scan sets, so we specify it separately.
  589. case $arg in
  590. *$quote_scanset* | *]* | *\|* | *\&* | *\(* | *\)* | "")
  591. arg="\"$arg\""
  592. ;;
  593. esac
  594. lastarg="$lastarg $arg"
  595. done
  596. IFS="$save_ifs"
  597. lastarg=`$echo "X$lastarg" | $Xsed -e "s/^ //"`
  598. # Add the arguments to base_compile.
  599. base_compile="$base_compile $lastarg"
  600. continue
  601. ;;
  602. * )
  603. # Accept the current argument as the source file.
  604. # The previous "srcfile" becomes the current argument.
  605. #
  606. lastarg="$srcfile"
  607. srcfile="$arg"
  608. ;;
  609. esac # case $arg
  610. ;;
  611. esac # case $arg_mode
  612. # Aesthetically quote the previous argument.
  613. lastarg=`$echo "X$lastarg" | $Xsed -e "$sed_quote_subst"`
  614. case $lastarg in
  615. # Double-quote args containing other shell metacharacters.
  616. # Many Bourne shells cannot handle close brackets correctly
  617. # in scan sets, and some SunOS ksh mistreat backslash-escaping
  618. # in scan sets (worked around with variable expansion),
  619. # and furthermore cannot handle '|' '&' '(' ')' in scan sets
  620. # at all, so we specify them separately.
  621. *$quote_scanset* | *]* | *\|* | *\&* | *\(* | *\)* | "")
  622. lastarg="\"$lastarg\""
  623. ;;
  624. esac
  625. base_compile="$base_compile $lastarg"
  626. done # for arg
  627. case $arg_mode in
  628. arg)
  629. $echo "$modename: you must specify an argument for -Xcompile"
  630. exit $EXIT_FAILURE
  631. ;;
  632. target)
  633. $echo "$modename: you must specify a target with \`-o'" 1>&2
  634. exit $EXIT_FAILURE
  635. ;;
  636. *)
  637. # Get the name of the library object.
  638. [ -z "$libobj" ] && libobj=`$echo "X$srcfile" | $Xsed -e 's%^.*/%%'`
  639. ;;
  640. esac
  641. # Recognize several different file suffixes.
  642. # If the user specifies -o file.o, it is replaced with file.lo
  643. xform='[cCFSifmso]'
  644. case $libobj in
  645. *.ada) xform=ada ;;
  646. *.adb) xform=adb ;;
  647. *.ads) xform=ads ;;
  648. *.asm) xform=asm ;;
  649. *.c++) xform=c++ ;;
  650. *.cc) xform=cc ;;
  651. *.ii) xform=ii ;;
  652. *.class) xform=class ;;
  653. *.cpp) xform=cpp ;;
  654. *.cxx) xform=cxx ;;
  655. *.f90) xform=f90 ;;
  656. *.for) xform=for ;;
  657. *.java) xform=java ;;
  658. esac
  659. libobj=`$echo "X$libobj" | $Xsed -e "s/\.$xform$/.lo/"`
  660. case $libobj in
  661. *.lo) obj=`$echo "X$libobj" | $Xsed -e "$lo2o"` ;;
  662. *)
  663. $echo "$modename: cannot determine name of library object from \`$libobj'" 1>&2
  664. exit $EXIT_FAILURE
  665. ;;
  666. esac
  667. func_infer_tag $base_compile
  668. for arg in $later; do
  669. case $arg in
  670. -static)
  671. build_old_libs=yes
  672. continue
  673. ;;
  674. -prefer-pic)
  675. pic_mode=yes
  676. continue
  677. ;;
  678. -prefer-non-pic)
  679. pic_mode=no
  680. continue
  681. ;;
  682. esac
  683. done
  684. objname=`$echo "X$obj" | $Xsed -e 's%^.*/%%'`
  685. xdir=`$echo "X$obj" | $Xsed -e 's%/[^/]*$%%'`
  686. if test "X$xdir" = "X$obj"; then
  687. xdir=
  688. else
  689. xdir=$xdir/
  690. fi
  691. lobj=${xdir}$objdir/$objname
  692. if test -z "$base_compile"; then
  693. $echo "$modename: you must specify a compilation command" 1>&2
  694. $echo "$help" 1>&2
  695. exit $EXIT_FAILURE
  696. fi
  697. # Delete any leftover library objects.
  698. if test "$build_old_libs" = yes; then
  699. removelist="$obj $lobj $libobj ${libobj}T"
  700. else
  701. removelist="$lobj $libobj ${libobj}T"
  702. fi
  703. $run $rm $removelist
  704. trap "$run $rm $removelist; exit $EXIT_FAILURE" 1 2 15
  705. # On Cygwin there's no "real" PIC flag so we must build both object types
  706. case $host_os in
  707. cygwin* | mingw* | pw32* | os2*)
  708. pic_mode=default
  709. ;;
  710. esac
  711. if test "$pic_mode" = no && test "$deplibs_check_method" != pass_all; then
  712. # non-PIC code in shared libraries is not supported
  713. pic_mode=default
  714. fi
  715. # Calculate the filename of the output object if compiler does
  716. # not support -o with -c
  717. if test "$compiler_c_o" = no; then
  718. output_obj=`$echo "X$srcfile" | $Xsed -e 's%^.*/%%' -e 's%\.[^.]*$%%'`.${objext}
  719. lockfile="$output_obj.lock"
  720. removelist="$removelist $output_obj $lockfile"
  721. trap "$run $rm $removelist; exit $EXIT_FAILURE" 1 2 15
  722. else
  723. output_obj=
  724. need_locks=no
  725. lockfile=
  726. fi
  727. # Lock this critical section if it is needed
  728. # We use this script file to make the link, it avoids creating a new file
  729. if test "$need_locks" = yes; then
  730. until $run ln "$progpath" "$lockfile" 2>/dev/null; do
  731. $show "Waiting for $lockfile to be removed"
  732. sleep 2
  733. done
  734. elif test "$need_locks" = warn; then
  735. if test -f "$lockfile"; then
  736. $echo "\
  737. *** ERROR, $lockfile exists and contains:
  738. `cat $lockfile 2>/dev/null`
  739. This indicates that another process is trying to use the same
  740. temporary object file, and libtool could not work around it because
  741. your compiler does not support \`-c' and \`-o' together. If you
  742. repeat this compilation, it may succeed, by chance, but you had better
  743. avoid parallel builds (make -j) in this platform, or get a better
  744. compiler."
  745. $run $rm $removelist
  746. exit $EXIT_FAILURE
  747. fi
  748. $echo $srcfile > "$lockfile"
  749. fi
  750. if test -n "$fix_srcfile_path"; then
  751. eval srcfile=\"$fix_srcfile_path\"
  752. fi
  753. $run $rm "$libobj" "${libobj}T"
  754. # Create a libtool object file (analogous to a ".la" file),
  755. # but don't create it if we're doing a dry run.
  756. test -z "$run" && cat > ${libobj}T <<EOF
  757. # $libobj - a libtool object file
  758. # Generated by $PROGRAM - GNU $PACKAGE $VERSION$TIMESTAMP
  759. #
  760. # Please DO NOT delete this file!
  761. # It is necessary for linking the library.
  762. # Name of the PIC object.
  763. EOF
  764. # Only build a PIC object if we are building libtool libraries.
  765. if test "$build_libtool_libs" = yes; then
  766. # Without this assignment, base_compile gets emptied.
  767. fbsd_hideous_sh_bug=$base_compile
  768. if test "$pic_mode" != no; then
  769. command="$base_compile $srcfile $pic_flag"
  770. else
  771. # Don't build PIC code
  772. command="$base_compile $srcfile"
  773. fi
  774. if test ! -d "${xdir}$objdir"; then
  775. $show "$mkdir ${xdir}$objdir"
  776. $run $mkdir ${xdir}$objdir
  777. status=$?
  778. if test "$status" -ne 0 && test ! -d "${xdir}$objdir"; then
  779. exit $status
  780. fi
  781. fi
  782. if test -z "$output_obj"; then
  783. # Place PIC objects in $objdir
  784. command="$command -o $lobj"
  785. fi
  786. $run $rm "$lobj" "$output_obj"
  787. $show "$command"
  788. if $run eval "$command"; then :
  789. else
  790. test -n "$output_obj" && $run $rm $removelist
  791. exit $EXIT_FAILURE
  792. fi
  793. if test "$need_locks" = warn &&
  794. test "X`cat $lockfile 2>/dev/null`" != "X$srcfile"; then
  795. $echo "\
  796. *** ERROR, $lockfile contains:
  797. `cat $lockfile 2>/dev/null`
  798. but it should contain:
  799. $srcfile
  800. This indicates that another process is trying to use the same
  801. temporary object file, and libtool could not work around it because
  802. your compiler does not support \`-c' and \`-o' together. If you
  803. repeat this compilation, it may succeed, by chance, but you had better
  804. avoid parallel builds (make -j) in this platform, or get a better
  805. compiler."
  806. $run $rm $removelist
  807. exit $EXIT_FAILURE
  808. fi
  809. # Just move the object if needed, then go on to compile the next one
  810. if test -n "$output_obj" && test "X$output_obj" != "X$lobj"; then
  811. $show "$mv $output_obj $lobj"
  812. if $run $mv $output_obj $lobj; then :
  813. else
  814. error=$?
  815. $run $rm $removelist
  816. exit $error
  817. fi
  818. fi
  819. # Append the name of the PIC object to the libtool object file.
  820. test -z "$run" && cat >> ${libobj}T <<EOF
  821. pic_object='$objdir/$objname'
  822. EOF
  823. # Allow error messages only from the first compilation.
  824. if test "$suppress_opt" = yes; then
  825. suppress_output=' >/dev/null 2>&1'
  826. fi
  827. else
  828. # No PIC object so indicate it doesn't exist in the libtool
  829. # object file.
  830. test -z "$run" && cat >> ${libobj}T <<EOF
  831. pic_object=none
  832. EOF
  833. fi
  834. # Only build a position-dependent object if we build old libraries.
  835. if test "$build_old_libs" = yes; then
  836. if test "$pic_mode" != yes; then
  837. # Don't build PIC code
  838. command="$base_compile $srcfile"
  839. else
  840. command="$base_compile $srcfile $pic_flag"
  841. fi
  842. if test "$compiler_c_o" = yes; then
  843. command="$command -o $obj"
  844. fi
  845. # Suppress compiler output if we already did a PIC compilation.
  846. command="$command$suppress_output"
  847. $run $rm "$obj" "$output_obj"
  848. $show "$command"
  849. if $run eval "$command"; then :
  850. else
  851. $run $rm $removelist
  852. exit $EXIT_FAILURE
  853. fi
  854. if test "$need_locks" = warn &&
  855. test "X`cat $lockfile 2>/dev/null`" != "X$srcfile"; then
  856. $echo "\
  857. *** ERROR, $lockfile contains:
  858. `cat $lockfile 2>/dev/null`
  859. but it should contain:
  860. $srcfile
  861. This indicates that another process is trying to use the same
  862. temporary object file, and libtool could not work around it because
  863. your compiler does not support \`-c' and \`-o' together. If you
  864. repeat this compilation, it may succeed, by chance, but you had better
  865. avoid parallel builds (make -j) in this platform, or get a better
  866. compiler."
  867. $run $rm $removelist
  868. exit $EXIT_FAILURE
  869. fi
  870. # Just move the object if needed
  871. if test -n "$output_obj" && test "X$output_obj" != "X$obj"; then
  872. $show "$mv $output_obj $obj"
  873. if $run $mv $output_obj $obj; then :
  874. else
  875. error=$?
  876. $run $rm $removelist
  877. exit $error
  878. fi
  879. fi
  880. # Append the name of the non-PIC object the libtool object file.
  881. # Only append if the libtool object file exists.
  882. test -z "$run" && cat >> ${libobj}T <<EOF
  883. # Name of the non-PIC object.
  884. non_pic_object='$objname'
  885. EOF
  886. else
  887. # Append the name of the non-PIC object the libtool object file.
  888. # Only append if the libtool object file exists.
  889. test -z "$run" && cat >> ${libobj}T <<EOF
  890. # Name of the non-PIC object.
  891. non_pic_object=none
  892. EOF
  893. fi
  894. $run $mv "${libobj}T" "${libobj}"
  895. # Unlock the critical section if it was locked
  896. if test "$need_locks" != no; then
  897. $run $rm "$lockfile"
  898. fi
  899. exit $EXIT_SUCCESS
  900. ;;
  901. # libtool link mode
  902. link | relink)
  903. modename="$modename: link"
  904. case $host in
  905. *-*-cygwin* | *-*-mingw* | *-*-pw32* | *-*-os2*)
  906. # It is impossible to link a dll without this setting, and
  907. # we shouldn't force the makefile maintainer to figure out
  908. # which system we are compiling for in order to pass an extra
  909. # flag for every libtool invocation.
  910. # allow_undefined=no
  911. # FIXME: Unfortunately, there are problems with the above when trying
  912. # to make a dll which has undefined symbols, in which case not
  913. # even a static library is built. For now, we need to specify
  914. # -no-undefined on the libtool link line when we can be certain
  915. # that all symbols are satisfied, otherwise we get a static library.
  916. allow_undefined=yes
  917. ;;
  918. *)
  919. allow_undefined=yes
  920. ;;
  921. esac
  922. libtool_args="$nonopt"
  923. base_compile="$nonopt $@"
  924. compile_command="$nonopt"
  925. finalize_command="$nonopt"
  926. compile_rpath=
  927. finalize_rpath=
  928. compile_shlibpath=
  929. finalize_shlibpath=
  930. convenience=
  931. old_convenience=
  932. deplibs=
  933. old_deplibs=
  934. compiler_flags=
  935. linker_flags=
  936. dllsearchpath=
  937. lib_search_path=`pwd`
  938. inst_prefix_dir=
  939. avoid_version=no
  940. dlfiles=
  941. dlprefiles=
  942. dlself=no
  943. export_dynamic=no
  944. export_symbols=
  945. export_symbols_regex=
  946. generated=
  947. libobjs=
  948. ltlibs=
  949. module=no
  950. no_install=no
  951. objs=
  952. non_pic_objects=
  953. precious_files_regex=
  954. prefer_static_libs=no
  955. preload=no
  956. prev=
  957. prevarg=
  958. release=
  959. rpath=
  960. xrpath=
  961. perm_rpath=
  962. temp_rpath=
  963. thread_safe=no
  964. vinfo=
  965. vinfo_number=no
  966. func_infer_tag $base_compile
  967. # We need to know -static, to get the right output filenames.
  968. for arg
  969. do
  970. case $arg in
  971. -all-static | -static)
  972. if test "X$arg" = "X-all-static"; then
  973. if test "$build_libtool_libs" = yes && test -z "$link_static_flag"; then
  974. $echo "$modename: warning: complete static linking is impossible in this configuration" 1>&2
  975. fi
  976. if test -n "$link_static_flag"; then
  977. dlopen_self=$dlopen_self_static
  978. fi
  979. else
  980. if test -z "$pic_flag" && test -n "$link_static_flag"; then
  981. dlopen_self=$dlopen_self_static
  982. fi
  983. fi
  984. build_libtool_libs=no
  985. build_old_libs=yes
  986. prefer_static_libs=yes
  987. break
  988. ;;
  989. esac
  990. done
  991. # See if our shared archives depend on static archives.
  992. test -n "$old_archive_from_new_cmds" && build_old_libs=yes
  993. # Go through the arguments, transforming them on the way.
  994. while test "$#" -gt 0; do
  995. arg="$1"
  996. shift
  997. case $arg in
  998. *$quote_scanset* | *]* | *\|* | *\&* | *\(* | *\)* | "")
  999. qarg=\"`$echo "X$arg" | $Xsed -e "$sed_quote_subst"`\" ### testsuite: skip nested quoting test
  1000. ;;
  1001. *) qarg=$arg ;;
  1002. esac
  1003. libtool_args="$libtool_args $qarg"
  1004. # If the previous option needs an argument, assign it.
  1005. if test -n "$prev"; then
  1006. case $prev in
  1007. output)
  1008. compile_command="$compile_command @OUTPUT@"
  1009. finalize_command="$finalize_command @OUTPUT@"
  1010. ;;
  1011. esac
  1012. case $prev in
  1013. dlfiles|dlprefiles)
  1014. if test "$preload" = no; then
  1015. # Add the symbol object into the linking commands.
  1016. compile_command="$compile_command @SYMFILE@"
  1017. finalize_command="$finalize_command @SYMFILE@"
  1018. preload=yes
  1019. fi
  1020. case $arg in
  1021. *.la | *.lo) ;; # We handle these cases below.
  1022. force)
  1023. if test "$dlself" = no; then
  1024. dlself=needless
  1025. export_dynamic=yes
  1026. fi
  1027. prev=
  1028. continue
  1029. ;;
  1030. self)
  1031. if test "$prev" = dlprefiles; then
  1032. dlself=yes
  1033. elif test "$prev" = dlfiles && test "$dlopen_self" != yes; then
  1034. dlself=yes
  1035. else
  1036. dlself=needless
  1037. export_dynamic=yes
  1038. fi
  1039. prev=
  1040. continue
  1041. ;;
  1042. *)
  1043. if test "$prev" = dlfiles; then
  1044. dlfiles="$dlfiles $arg"
  1045. else
  1046. dlprefiles="$dlprefiles $arg"
  1047. fi
  1048. prev=
  1049. continue
  1050. ;;
  1051. esac
  1052. ;;
  1053. expsyms)
  1054. export_symbols="$arg"
  1055. if test ! -f "$arg"; then
  1056. $echo "$modename: symbol file \`$arg' does not exist"
  1057. exit $EXIT_FAILURE
  1058. fi
  1059. prev=
  1060. continue
  1061. ;;
  1062. expsyms_regex)
  1063. export_symbols_regex="$arg"
  1064. prev=
  1065. continue
  1066. ;;
  1067. inst_prefix)
  1068. inst_prefix_dir="$arg"
  1069. prev=
  1070. continue
  1071. ;;
  1072. precious_regex)
  1073. precious_files_regex="$arg"
  1074. prev=
  1075. continue
  1076. ;;
  1077. release)
  1078. release="-$arg"
  1079. prev=
  1080. continue
  1081. ;;
  1082. objectlist)
  1083. if test -f "$arg"; then
  1084. save_arg=$arg
  1085. moreargs=
  1086. for fil in `cat $save_arg`
  1087. do
  1088. # moreargs="$moreargs $fil"
  1089. arg=$fil
  1090. # A libtool-controlled object.
  1091. # Check to see that this really is a libtool object.
  1092. if (${SED} -e '2q' $arg | grep "^# Generated by .*$PACKAGE") >/dev/null 2>&1; then
  1093. pic_object=
  1094. non_pic_object=
  1095. # Read the .lo file
  1096. # If there is no directory component, then add one.
  1097. case $arg in
  1098. */* | *\\*) . $arg ;;
  1099. *) . ./$arg ;;
  1100. esac
  1101. if test -z "$pic_object" || \
  1102. test -z "$non_pic_object" ||
  1103. test "$pic_object" = none && \
  1104. test "$non_pic_object" = none; then
  1105. $echo "$modename: cannot find name of object for \`$arg'" 1>&2
  1106. exit $EXIT_FAILURE
  1107. fi
  1108. # Extract subdirectory from the argument.
  1109. xdir=`$echo "X$arg" | $Xsed -e 's%/[^/]*$%%'`
  1110. if test "X$xdir" = "X$arg"; then
  1111. xdir=
  1112. else
  1113. xdir="$xdir/"
  1114. fi
  1115. if test "$pic_object" != none; then
  1116. # Prepend the subdirectory the object is found in.
  1117. pic_object="$xdir$pic_object"
  1118. if test "$prev" = dlfiles; then
  1119. if test "$build_libtool_libs" = yes && test "$dlopen_support" = yes; then
  1120. dlfiles="$dlfiles $pic_object"
  1121. prev=
  1122. continue
  1123. else
  1124. # If libtool objects are unsupported, then we need to preload.
  1125. prev=dlprefiles
  1126. fi
  1127. fi
  1128. # CHECK ME: I think I busted this. -Ossama
  1129. if test "$prev" = dlprefiles; then
  1130. # Preload the old-style object.
  1131. dlprefiles="$dlprefiles $pic_object"
  1132. prev=
  1133. fi
  1134. # A PIC object.
  1135. libobjs="$libobjs $pic_object"
  1136. arg="$pic_object"
  1137. fi
  1138. # Non-PIC object.
  1139. if test "$non_pic_object" != none; then
  1140. # Prepend the subdirectory the object is found in.
  1141. non_pic_object="$xdir$non_pic_object"
  1142. # A standard non-PIC object
  1143. non_pic_objects="$non_pic_objects $non_pic_object"
  1144. if test -z "$pic_object" || test "$pic_object" = none ; then
  1145. arg="$non_pic_object"
  1146. fi
  1147. fi
  1148. else
  1149. # Only an error if not doing a dry-run.
  1150. if test -z "$run"; then
  1151. $echo "$modename: \`$arg' is not a valid libtool object" 1>&2
  1152. exit $EXIT_FAILURE
  1153. else
  1154. # Dry-run case.
  1155. # Extract subdirectory from the argument.
  1156. xdir=`$echo "X$arg" | $Xsed -e 's%/[^/]*$%%'`
  1157. if test "X$xdir" = "X$arg"; then
  1158. xdir=
  1159. else
  1160. xdir="$xdir/"
  1161. fi
  1162. pic_object=`$echo "X${xdir}${objdir}/${arg}" | $Xsed -e "$lo2o"`
  1163. non_pic_object=`$echo "X${xdir}${arg}" | $Xsed -e "$lo2o"`
  1164. libobjs="$libobjs $pic_object"
  1165. non_pic_objects="$non_pic_objects $non_pic_object"
  1166. fi
  1167. fi
  1168. done
  1169. else
  1170. $echo "$modename: link input file \`$save_arg' does not exist"
  1171. exit $EXIT_FAILURE
  1172. fi
  1173. arg=$save_arg
  1174. prev=
  1175. continue
  1176. ;;
  1177. rpath | xrpath)
  1178. # We need an absolute path.
  1179. case $arg in
  1180. [\\/]* | [A-Za-z]:[\\/]*) ;;
  1181. *)
  1182. $echo "$modename: only absolute run-paths are allowed" 1>&2
  1183. exit $EXIT_FAILURE
  1184. ;;
  1185. esac
  1186. if test "$prev" = rpath; then
  1187. case "$rpath " in
  1188. *" $arg "*) ;;
  1189. *) rpath="$rpath $arg" ;;
  1190. esac
  1191. else
  1192. case "$xrpath " in
  1193. *" $arg "*) ;;
  1194. *) xrpath="$xrpath $arg" ;;
  1195. esac
  1196. fi
  1197. prev=
  1198. continue
  1199. ;;
  1200. xcompiler)
  1201. compiler_flags="$compiler_flags $qarg"
  1202. prev=
  1203. compile_command="$compile_command $qarg"
  1204. finalize_command="$finalize_command $qarg"
  1205. continue
  1206. ;;
  1207. xlinker)
  1208. linker_flags="$linker_flags $qarg"
  1209. compiler_flags="$compiler_flags $wl$qarg"
  1210. prev=
  1211. compile_command="$compile_command $wl$qarg"
  1212. finalize_command="$finalize_command $wl$qarg"
  1213. continue
  1214. ;;
  1215. xcclinker)
  1216. linker_flags="$linker_flags $qarg"
  1217. compiler_flags="$compiler_flags $qarg"
  1218. prev=
  1219. compile_command="$compile_command $qarg"
  1220. finalize_command="$finalize_command $qarg"
  1221. continue
  1222. ;;
  1223. shrext)
  1224. shrext_cmds="$arg"
  1225. prev=
  1226. continue
  1227. ;;
  1228. darwin_framework)
  1229. compiler_flags="$compiler_flags $arg"
  1230. prev=
  1231. continue
  1232. ;;
  1233. *)
  1234. eval "$prev=\"\$arg\""
  1235. prev=
  1236. continue
  1237. ;;
  1238. esac
  1239. fi # test -n "$prev"
  1240. prevarg="$arg"
  1241. case $arg in
  1242. -all-static)
  1243. if test -n "$link_static_flag"; then
  1244. compile_command="$compile_command $link_static_flag"
  1245. finalize_command="$finalize_command $link_static_flag"
  1246. fi
  1247. continue
  1248. ;;
  1249. -allow-undefined)
  1250. # FIXME: remove this flag sometime in the future.
  1251. $echo "$modename: \`-allow-undefined' is deprecated because it is the default" 1>&2
  1252. continue
  1253. ;;
  1254. -avoid-version)
  1255. avoid_version=yes
  1256. continue
  1257. ;;
  1258. -dlopen)
  1259. prev=dlfiles
  1260. continue
  1261. ;;
  1262. -dlpreopen)
  1263. prev=dlprefiles
  1264. continue
  1265. ;;
  1266. -export-dynamic)
  1267. export_dynamic=yes
  1268. continue
  1269. ;;
  1270. -export-symbols | -export-symbols-regex)
  1271. if test -n "$export_symbols" || test -n "$export_symbols_regex"; then
  1272. $echo "$modename: more than one -exported-symbols argument is not allowed"
  1273. exit $EXIT_FAILURE
  1274. fi
  1275. if test "X$arg" = "X-export-symbols"; then
  1276. prev=expsyms
  1277. else
  1278. prev=expsyms_regex
  1279. fi
  1280. continue
  1281. ;;
  1282. -framework)
  1283. prev=darwin_framework
  1284. compiler_flags="$compiler_flags $arg"
  1285. continue
  1286. ;;
  1287. -inst-prefix-dir)
  1288. prev=inst_prefix
  1289. continue
  1290. ;;
  1291. # The native IRIX linker understands -LANG:*, -LIST:* and -LNO:*
  1292. # so, if we see these flags be careful not to treat them like -L
  1293. -L[A-Z][A-Z]*:*)
  1294. case $with_gcc/$host in
  1295. no/*-*-irix* | /*-*-irix*)
  1296. compile_command="$compile_command $arg"
  1297. finalize_command="$finalize_command $arg"
  1298. ;;
  1299. esac
  1300. continue
  1301. ;;
  1302. -L*)
  1303. dir=`$echo "X$arg" | $Xsed -e 's/^-L//'`
  1304. # We need an absolute path.
  1305. case $dir in
  1306. [\\/]* | [A-Za-z]:[\\/]*) ;;
  1307. *)
  1308. absdir=`cd "$dir" && pwd`
  1309. if test -z "$absdir"; then
  1310. $echo "$modename: cannot determine absolute directory name of \`$dir'" 1>&2
  1311. exit $EXIT_FAILURE
  1312. fi
  1313. dir="$absdir"
  1314. ;;
  1315. esac
  1316. case "$deplibs " in
  1317. *" -L$dir "*) ;;
  1318. *)
  1319. deplibs="$deplibs -L$dir"
  1320. lib_search_path="$lib_search_path $dir"
  1321. ;;
  1322. esac
  1323. case $host in
  1324. *-*-cygwin* | *-*-mingw* | *-*-pw32* | *-*-os2*)
  1325. case :$dllsearchpath: in
  1326. *":$dir:"*) ;;
  1327. *) dllsearchpath="$dllsearchpath:$dir";;
  1328. esac
  1329. ;;
  1330. esac
  1331. continue
  1332. ;;
  1333. -l*)
  1334. if test "X$arg" = "X-lc" || test "X$arg" = "X-lm"; then
  1335. case $host in
  1336. *-*-cygwin* | *-*-pw32* | *-*-beos*)
  1337. # These systems don't actually have a C or math library (as such)
  1338. continue
  1339. ;;
  1340. *-*-mingw* | *-*-os2*)
  1341. # These systems don't actually have a C library (as such)
  1342. test "X$arg" = "X-lc" && continue
  1343. ;;
  1344. *-*-openbsd* | *-*-freebsd* | *-*-dragonfly*)
  1345. # Do not include libc due to us having libc/libc_r.
  1346. test "X$arg" = "X-lc" && continue
  1347. ;;
  1348. *-*-rhapsody* | *-*-darwin1.[012])
  1349. # Rhapsody C and math libraries are in the System framework
  1350. deplibs="$deplibs -framework System"
  1351. continue
  1352. esac
  1353. elif test "X$arg" = "X-lc_r"; then
  1354. case $host in
  1355. *-*-openbsd* | *-*-freebsd* | *-*-dragonfly*)
  1356. # Do not include libc_r directly, use -pthread flag.
  1357. continue
  1358. ;;
  1359. esac
  1360. fi
  1361. deplibs="$deplibs $arg"
  1362. continue
  1363. ;;
  1364. # Tru64 UNIX uses -model [arg] to determine the layout of C++
  1365. # classes, name mangling, and exception handling.
  1366. -model)
  1367. compile_command="$compile_command $arg"
  1368. compiler_flags="$compiler_flags $arg"
  1369. finalize_command="$finalize_command $arg"
  1370. prev=xcompiler
  1371. continue
  1372. ;;
  1373. -mt|-mthreads|-kthread|-Kthread|-pthread|-pthreads|--thread-safe)
  1374. compiler_flags="$compiler_flags $arg"
  1375. compile_command="$compile_command $arg"
  1376. finalize_command="$finalize_command $arg"
  1377. continue
  1378. ;;
  1379. -module)
  1380. module=yes
  1381. continue
  1382. ;;
  1383. # -64, -mips[0-9] enable 64-bit mode on the SGI compiler
  1384. # -r[0-9][0-9]* specifies the processor on the SGI compiler
  1385. # -xarch=*, -xtarget=* enable 64-bit mode on the Sun compiler
  1386. # +DA*, +DD* enable 64-bit mode on the HP compiler
  1387. # -q* pass through compiler args for the IBM compiler
  1388. # -m* pass through architecture-specific compiler args for GCC
  1389. -64|-mips[0-9]|-r[0-9][0-9]*|-xarch=*|-xtarget=*|+DA*|+DD*|-q*|-m*)
  1390. # Unknown arguments in both finalize_command and compile_command need
  1391. # to be aesthetically quoted because they are evaled later.
  1392. arg=`$echo "X$arg" | $Xsed -e "$sed_quote_subst"`
  1393. case $arg in
  1394. *$quote_scanset* | *]* | *\|* | *\&* | *\(* | *\)* | "")
  1395. arg="\"$arg\""
  1396. ;;
  1397. esac
  1398. compile_command="$compile_command $arg"
  1399. finalize_command="$finalize_command $arg"
  1400. if test "$with_gcc" = "yes" ; then
  1401. compiler_flags="$compiler_flags $arg"
  1402. fi
  1403. continue
  1404. ;;
  1405. -shrext)
  1406. prev=shrext
  1407. continue
  1408. ;;
  1409. -no-fast-install)
  1410. fast_install=no
  1411. continue
  1412. ;;
  1413. -no-install)
  1414. case $host in
  1415. *-*-cygwin* | *-*-mingw* | *-*-pw32* | *-*-os2*)
  1416. # The PATH hackery in wrapper scripts is required on Windows
  1417. # in order for the loader to find any dlls it needs.
  1418. $echo "$modename: warning: \`-no-install' is ignored for $host" 1>&2
  1419. $echo "$modename: warning: assuming \`-no-fast-install' instead" 1>&2
  1420. fast_install=no
  1421. ;;
  1422. *) no_install=yes ;;
  1423. esac
  1424. continue
  1425. ;;
  1426. -no-undefined)
  1427. allow_undefined=no
  1428. continue
  1429. ;;
  1430. -objectlist)
  1431. prev=objectlist
  1432. continue
  1433. ;;
  1434. -o) prev=output ;;
  1435. -precious-files-regex)
  1436. prev=precious_regex
  1437. continue
  1438. ;;
  1439. -release)
  1440. prev=release
  1441. continue
  1442. ;;
  1443. -rpath)
  1444. prev=rpath
  1445. continue
  1446. ;;
  1447. -R)
  1448. prev=xrpath
  1449. continue
  1450. ;;
  1451. -R*)
  1452. dir=`$echo "X$arg" | $Xsed -e 's/^-R//'`
  1453. # We need an absolute path.
  1454. case $dir in
  1455. [\\/]* | [A-Za-z]:[\\/]*) ;;
  1456. *)
  1457. $echo "$modename: only absolute run-paths are allowed" 1>&2
  1458. exit $EXIT_FAILURE
  1459. ;;
  1460. esac
  1461. case "$xrpath " in
  1462. *" $dir "*) ;;
  1463. *) xrpath="$xrpath $dir" ;;
  1464. esac
  1465. continue
  1466. ;;
  1467. -static)
  1468. # The effects of -static are defined in a previous loop.
  1469. # We used to do the same as -all-static on platforms that
  1470. # didn't have a PIC flag, but the assumption that the effects
  1471. # would be equivalent was wrong. It would break on at least
  1472. # Digital Unix and AIX.
  1473. continue
  1474. ;;
  1475. -thread-safe)
  1476. thread_safe=yes
  1477. continue
  1478. ;;
  1479. -version-info)
  1480. prev=vinfo
  1481. continue
  1482. ;;
  1483. -version-number)
  1484. prev=vinfo
  1485. vinfo_number=yes
  1486. continue
  1487. ;;
  1488. -Wc,*)
  1489. args=`$echo "X$arg" | $Xsed -e "$sed_quote_subst" -e 's/^-Wc,//'`
  1490. arg=
  1491. save_ifs="$IFS"; IFS=','
  1492. for flag in $args; do
  1493. IFS="$save_ifs"
  1494. case $flag in
  1495. *$quote_scanset* | *]* | *\|* | *\&* | *\(* | *\)* | "")
  1496. flag="\"$flag\""
  1497. ;;
  1498. esac
  1499. arg="$arg $wl$flag"
  1500. compiler_flags="$compiler_flags $flag"
  1501. done
  1502. IFS="$save_ifs"
  1503. arg=`$echo "X$arg" | $Xsed -e "s/^ //"`
  1504. ;;
  1505. -Wl,*)
  1506. args=`$echo "X$arg" | $Xsed -e "$sed_quote_subst" -e 's/^-Wl,//'`
  1507. arg=
  1508. save_ifs="$IFS"; IFS=','
  1509. for flag in $args; do
  1510. IFS="$save_ifs"
  1511. case $flag in
  1512. *$quote_scanset* | *]* | *\|* | *\&* | *\(* | *\)* | "")
  1513. flag="\"$flag\""
  1514. ;;
  1515. esac
  1516. arg="$arg $wl$flag"
  1517. compiler_flags="$compiler_flags $wl$flag"
  1518. linker_flags="$linker_flags $flag"
  1519. done
  1520. IFS="$save_ifs"
  1521. arg=`$echo "X$arg" | $Xsed -e "s/^ //"`
  1522. ;;
  1523. -Xcompiler)
  1524. prev=xcompiler
  1525. continue
  1526. ;;
  1527. -Xlinker)
  1528. prev=xlinker
  1529. continue
  1530. ;;
  1531. -XCClinker)
  1532. prev=xcclinker
  1533. continue
  1534. ;;
  1535. # Some other compiler flag.
  1536. -* | +*)
  1537. # Unknown arguments in both finalize_command and compile_command need
  1538. # to be aesthetically quoted because they are evaled later.
  1539. arg=`$echo "X$arg" | $Xsed -e "$sed_quote_subst"`
  1540. case $arg in
  1541. *$quote_scanset* | *]* | *\|* | *\&* | *\(* | *\)* | "")
  1542. arg="\"$arg\""
  1543. ;;
  1544. esac
  1545. ;;
  1546. *.$objext)
  1547. # A standard object.
  1548. objs="$objs $arg"
  1549. ;;
  1550. *.lo)
  1551. # A libtool-controlled object.
  1552. # Check to see that this really is a libtool object.
  1553. if (${SED} -e '2q' $arg | grep "^# Generated by .*$PACKAGE") >/dev/null 2>&1; then
  1554. pic_object=
  1555. non_pic_object=
  1556. # Read the .lo file
  1557. # If there is no directory component, then add one.
  1558. case $arg in
  1559. */* | *\\*) . $arg ;;
  1560. *) . ./$arg ;;
  1561. esac
  1562. if test -z "$pic_object" || \
  1563. test -z "$non_pic_object" ||
  1564. test "$pic_object" = none && \
  1565. test "$non_pic_object" = none; then
  1566. $echo "$modename: cannot find name of object for \`$arg'" 1>&2
  1567. exit $EXIT_FAILURE
  1568. fi
  1569. # Extract subdirectory from the argument.
  1570. xdir=`$echo "X$arg" | $Xsed -e 's%/[^/]*$%%'`
  1571. if test "X$xdir" = "X$arg"; then
  1572. xdir=
  1573. else
  1574. xdir="$xdir/"
  1575. fi
  1576. if test "$pic_object" != none; then
  1577. # Prepend the subdirectory the object is found in.
  1578. pic_object="$xdir$pic_object"
  1579. if test "$prev" = dlfiles; then
  1580. if test "$build_libtool_libs" = yes && test "$dlopen_support" = yes; then
  1581. dlfiles="$dlfiles $pic_object"
  1582. prev=
  1583. continue
  1584. else
  1585. # If libtool objects are unsupported, then we need to preload.
  1586. prev=dlprefiles
  1587. fi
  1588. fi
  1589. # CHECK ME: I think I busted this. -Ossama
  1590. if test "$prev" = dlprefiles; then
  1591. # Preload the old-style object.
  1592. dlprefiles="$dlprefiles $pic_object"
  1593. prev=
  1594. fi
  1595. # A PIC object.
  1596. libobjs="$libobjs $pic_object"
  1597. arg="$pic_object"
  1598. fi
  1599. # Non-PIC object.
  1600. if test "$non_pic_object" != none; then
  1601. # Prepend the subdirectory the object is found in.
  1602. non_pic_object="$xdir$non_pic_object"
  1603. # A standard non-PIC object
  1604. non_pic_objects="$non_pic_objects $non_pic_object"
  1605. if test -z "$pic_object" || test "$pic_object" = none ; then
  1606. arg="$non_pic_object"
  1607. fi
  1608. fi
  1609. else
  1610. # Only an error if not doing a dry-run.
  1611. if test -z "$run"; then
  1612. $echo "$modename: \`$arg' is not a valid libtool object" 1>&2
  1613. exit $EXIT_FAILURE
  1614. else
  1615. # Dry-run case.
  1616. # Extract subdirectory from the argument.
  1617. xdir=`$echo "X$arg" | $Xsed -e 's%/[^/]*$%%'`
  1618. if test "X$xdir" = "X$arg"; then
  1619. xdir=
  1620. else
  1621. xdir="$xdir/"
  1622. fi
  1623. pic_object=`$echo "X${xdir}${objdir}/${arg}" | $Xsed -e "$lo2o"`
  1624. non_pic_object=`$echo "X${xdir}${arg}" | $Xsed -e "$lo2o"`
  1625. libobjs="$libobjs $pic_object"
  1626. non_pic_objects="$non_pic_objects $non_pic_object"
  1627. fi
  1628. fi
  1629. ;;
  1630. *.$libext)
  1631. # An archive.
  1632. deplibs="$deplibs $arg"
  1633. old_deplibs="$old_deplibs $arg"
  1634. continue
  1635. ;;
  1636. *.la)
  1637. # A libtool-controlled library.
  1638. if test "$prev" = dlfiles; then
  1639. # This library was specified with -dlopen.
  1640. dlfiles="$dlfiles $arg"
  1641. prev=
  1642. elif test "$prev" = dlprefiles; then
  1643. # The library was specified with -dlpreopen.
  1644. dlprefiles="$dlprefiles $arg"
  1645. prev=
  1646. else
  1647. deplibs="$deplibs $arg"
  1648. fi
  1649. continue
  1650. ;;
  1651. # Some other compiler argument.
  1652. *)
  1653. # Unknown arguments in both finalize_command and compile_command need
  1654. # to be aesthetically quoted because they are evaled later.
  1655. arg=`$echo "X$arg" | $Xsed -e "$sed_quote_subst"`
  1656. case $arg in
  1657. *$quote_scanset* | *]* | *\|* | *\&* | *\(* | *\)* | "")
  1658. arg="\"$arg\""
  1659. ;;
  1660. esac
  1661. ;;
  1662. esac # arg
  1663. # Now actually substitute the argument into the commands.
  1664. if test -n "$arg"; then
  1665. compile_command="$compile_command $arg"
  1666. finalize_command="$finalize_command $arg"
  1667. fi
  1668. done # argument parsing loop
  1669. if test -n "$prev"; then
  1670. $echo "$modename: the \`$prevarg' option requires an argument" 1>&2
  1671. $echo "$help" 1>&2
  1672. exit $EXIT_FAILURE
  1673. fi
  1674. if test "$export_dynamic" = yes && test -n "$export_dynamic_flag_spec"; then
  1675. eval arg=\"$export_dynamic_flag_spec\"
  1676. compile_command="$compile_command $arg"
  1677. finalize_command="$finalize_command $arg"
  1678. fi
  1679. oldlibs=
  1680. # calculate the name of the file, without its directory
  1681. outputname=`$echo "X$output" | $Xsed -e 's%^.*/%%'`
  1682. libobjs_save="$libobjs"
  1683. if test -n "$shlibpath_var"; then
  1684. # get the directories listed in $shlibpath_var
  1685. eval shlib_search_path=\`\$echo \"X\${$shlibpath_var}\" \| \$Xsed -e \'s/:/ /g\'\`
  1686. else
  1687. shlib_search_path=
  1688. fi
  1689. eval sys_lib_search_path=\"$sys_lib_search_path_spec\"
  1690. eval sys_lib_dlsearch_path=\"$sys_lib_dlsearch_path_spec\"
  1691. output_objdir=`$echo "X$output" | $Xsed -e 's%/[^/]*$%%'`
  1692. if test "X$output_objdir" = "X$output"; then
  1693. output_objdir="$objdir"
  1694. else
  1695. output_objdir="$output_objdir/$objdir"
  1696. fi
  1697. # Create the object directory.
  1698. if test ! -d "$output_objdir"; then
  1699. $show "$mkdir $output_objdir"
  1700. $run $mkdir $output_objdir
  1701. status=$?
  1702. if test "$status" -ne 0 && test ! -d "$output_objdir"; then
  1703. exit $status
  1704. fi
  1705. fi
  1706. # Determine the type of output
  1707. case $output in
  1708. "")
  1709. $echo "$modename: you must specify an output file" 1>&2
  1710. $echo "$help" 1>&2
  1711. exit $EXIT_FAILURE
  1712. ;;
  1713. *.$libext) linkmode=oldlib ;;
  1714. *.lo | *.$objext) linkmode=obj ;;
  1715. *.la) linkmode=lib ;;
  1716. *) linkmode=prog ;; # Anything else should be a program.
  1717. esac
  1718. case $host in
  1719. *cygwin* | *mingw* | *pw32*)
  1720. # don't eliminate duplications in $postdeps and $predeps
  1721. duplicate_compiler_generated_deps=yes
  1722. ;;
  1723. *)
  1724. duplicate_compiler_generated_deps=$duplicate_deps
  1725. ;;
  1726. esac
  1727. specialdeplibs=
  1728. libs=
  1729. # Find all interdependent deplibs by searching for libraries
  1730. # that are linked more than once (e.g. -la -lb -la)
  1731. for deplib in $deplibs; do
  1732. if test "X$duplicate_deps" = "Xyes" ; then
  1733. case "$libs " in
  1734. *" $deplib "*) specialdeplibs="$specialdeplibs $deplib" ;;
  1735. esac
  1736. fi
  1737. libs="$libs $deplib"
  1738. done
  1739. if test "$linkmode" = lib; then
  1740. libs="$predeps $libs $compiler_lib_search_path $postdeps"
  1741. # Compute libraries that are listed more than once in $predeps
  1742. # $postdeps and mark them as special (i.e., whose duplicates are
  1743. # not to be eliminated).
  1744. pre_post_deps=
  1745. if test "X$duplicate_compiler_generated_deps" = "Xyes" ; then
  1746. for pre_post_dep in $predeps $postdeps; do
  1747. case "$pre_post_deps " in
  1748. *" $pre_post_dep "*) specialdeplibs="$specialdeplibs $pre_post_deps" ;;
  1749. esac
  1750. pre_post_deps="$pre_post_deps $pre_post_dep"
  1751. done
  1752. fi
  1753. pre_post_deps=
  1754. fi
  1755. deplibs=
  1756. newdependency_libs=
  1757. newlib_search_path=
  1758. need_relink=no # whether we're linking any uninstalled libtool libraries
  1759. notinst_deplibs= # not-installed libtool libraries
  1760. notinst_path= # paths that contain not-installed libtool libraries
  1761. case $linkmode in
  1762. lib)
  1763. passes="conv link"
  1764. for file in $dlfiles $dlprefiles; do
  1765. case $file in
  1766. *.la) ;;
  1767. *)
  1768. $echo "$modename: libraries can \`-dlopen' only libtool libraries: $file" 1>&2
  1769. exit $EXIT_FAILURE
  1770. ;;
  1771. esac
  1772. done
  1773. ;;
  1774. prog)
  1775. compile_deplibs=
  1776. finalize_deplibs=
  1777. alldeplibs=no
  1778. newdlfiles=
  1779. newdlprefiles=
  1780. passes="conv scan dlopen dlpreopen link"
  1781. ;;
  1782. *) passes="conv"
  1783. ;;
  1784. esac
  1785. for pass in $passes; do
  1786. if test "$linkmode,$pass" = "lib,link" ||
  1787. test "$linkmode,$pass" = "prog,scan"; then
  1788. libs="$deplibs"
  1789. deplibs=
  1790. fi
  1791. if test "$linkmode" = prog; then
  1792. case $pass in
  1793. dlopen) libs="$dlfiles" ;;
  1794. dlpreopen) libs="$dlprefiles" ;;
  1795. link) libs="$deplibs %DEPLIBS% $dependency_libs" ;;
  1796. esac
  1797. fi
  1798. if test "$pass" = dlopen; then
  1799. # Collect dlpreopened libraries
  1800. save_deplibs="$deplibs"
  1801. deplibs=
  1802. fi
  1803. for deplib in $libs; do
  1804. lib=
  1805. found=no
  1806. case $deplib in
  1807. -mt|-mthreads|-kthread|-Kthread|-pthread|-pthreads|--thread-safe)
  1808. if test "$linkmode,$pass" = "prog,link"; then
  1809. compile_deplibs="$deplib $compile_deplibs"
  1810. finalize_deplibs="$deplib $finalize_deplibs"
  1811. else
  1812. compiler_flags="$compiler_flags $deplib"
  1813. fi
  1814. continue
  1815. ;;
  1816. -l*)
  1817. if test "$linkmode" != lib && test "$linkmode" != prog; then
  1818. $echo "$modename: warning: \`-l' is ignored for archives/objects" 1>&2
  1819. continue
  1820. fi
  1821. name=`$echo "X$deplib" | $Xsed -e 's/^-l//'`
  1822. for searchdir in $newlib_search_path $lib_search_path $sys_lib_search_path $shlib_search_path; do
  1823. for search_ext in .la $std_shrext .so .a; do
  1824. # Search the libtool library
  1825. lib="$searchdir/lib${name}${search_ext}"
  1826. if test -f "$lib"; then
  1827. if test "$search_ext" = ".la"; then
  1828. found=yes
  1829. else
  1830. found=no
  1831. fi
  1832. break 2
  1833. fi
  1834. done
  1835. done
  1836. if test "$found" != yes; then
  1837. # deplib doesn't seem to be a libtool library
  1838. if test "$linkmode,$pass" = "prog,link"; then
  1839. compile_deplibs="$deplib $compile_deplibs"
  1840. finalize_deplibs="$deplib $finalize_deplibs"
  1841. else
  1842. deplibs="$deplib $deplibs"
  1843. test "$linkmode" = lib && newdependency_libs="$deplib $newdependency_libs"
  1844. fi
  1845. continue
  1846. else # deplib is a libtool library
  1847. # If $allow_libtool_libs_with_static_runtimes && $deplib is a stdlib,
  1848. # We need to do some special things here, and not later.
  1849. if test "X$allow_libtool_libs_with_static_runtimes" = "Xyes" ; then
  1850. case " $predeps $postdeps " in
  1851. *" $deplib "*)
  1852. if (${SED} -e '2q' $lib |
  1853. grep "^# Generated by .*$PACKAGE") >/dev/null 2>&1; then
  1854. library_names=
  1855. old_library=
  1856. case $lib in
  1857. */* | *\\*) . $lib ;;
  1858. *) . ./$lib ;;
  1859. esac
  1860. for l in $old_library $library_names; do
  1861. ll="$l"
  1862. done
  1863. if test "X$ll" = "X$old_library" ; then # only static version available
  1864. found=no
  1865. ladir=`$echo "X$lib" | $Xsed -e 's%/[^/]*$%%'`
  1866. test "X$ladir" = "X$lib" && ladir="."
  1867. lib=$ladir/$old_library
  1868. if test "$linkmode,$pass" = "prog,link"; then
  1869. compile_deplibs="$deplib $compile_deplibs"
  1870. finalize_deplibs="$deplib $finalize_deplibs"
  1871. else
  1872. deplibs="$deplib $deplibs"
  1873. test "$linkmode" = lib && newdependency_libs="$deplib $newdependency_libs"
  1874. fi
  1875. continue
  1876. fi
  1877. fi
  1878. ;;
  1879. *) ;;
  1880. esac
  1881. fi
  1882. fi
  1883. ;; # -l
  1884. -L*)
  1885. case $linkmode in
  1886. lib)
  1887. deplibs="$deplib $deplibs"
  1888. test "$pass" = conv && continue
  1889. newdependency_libs="$deplib $newdependency_libs"
  1890. newlib_search_path="$newlib_search_path "`$echo "X$deplib" | $Xsed -e 's/^-L//'`
  1891. ;;
  1892. prog)
  1893. if test "$pass" = conv; then
  1894. deplibs="$deplib $deplibs"
  1895. continue
  1896. fi
  1897. if test "$pass" = scan; then
  1898. deplibs="$deplib $deplibs"
  1899. else
  1900. compile_deplibs="$deplib $compile_deplibs"
  1901. finalize_deplibs="$deplib $finalize_deplibs"
  1902. fi
  1903. newlib_search_path="$newlib_search_path "`$echo "X$deplib" | $Xsed -e 's/^-L//'`
  1904. ;;
  1905. *)
  1906. $echo "$modename: warning: \`-L' is ignored for archives/objects" 1>&2
  1907. ;;
  1908. esac # linkmode
  1909. continue
  1910. ;; # -L
  1911. -R*)
  1912. if test "$pass" = link; then
  1913. dir=`$echo "X$deplib" | $Xsed -e 's/^-R//'`
  1914. # Make sure the xrpath contains only unique directories.
  1915. case "$xrpath " in
  1916. *" $dir "*) ;;
  1917. *) xrpath="$xrpath $dir" ;;
  1918. esac
  1919. fi
  1920. deplibs="$deplib $deplibs"
  1921. continue
  1922. ;;
  1923. *.la) lib="$deplib" ;;
  1924. *.$libext)
  1925. if test "$pass" = conv; then
  1926. deplibs="$deplib $deplibs"
  1927. continue
  1928. fi
  1929. case $linkmode in
  1930. lib)
  1931. valid_a_lib=no
  1932. case $deplibs_check_method in
  1933. match_pattern*)
  1934. set dummy $deplibs_check_method
  1935. match_pattern_regex=`expr "$deplibs_check_method" : "$2 \(.*\)"`
  1936. if eval $echo \"$deplib\" 2>/dev/null \
  1937. | $SED 10q \
  1938. | $EGREP "$match_pattern_regex" > /dev/null; then
  1939. valid_a_lib=yes
  1940. fi
  1941. ;;
  1942. pass_all)
  1943. valid_a_lib=yes
  1944. ;;
  1945. esac
  1946. if test "$valid_a_lib" != yes; then
  1947. $echo
  1948. $echo "*** Warning: Trying to link with static lib archive $deplib."
  1949. $echo "*** I have the capability to make that library automatically link in when"
  1950. $echo "*** you link to this library. But I can only do this if you have a"
  1951. $echo "*** shared version of the library, which you do not appear to have"
  1952. $echo "*** because the file extensions .$libext of this argument makes me believe"
  1953. $echo "*** that it is just a static archive that I should not used here."
  1954. else
  1955. $echo
  1956. $echo "*** Warning: Linking the shared library $output against the"
  1957. $echo "*** static library $deplib is not portable!"
  1958. deplibs="$deplib $deplibs"
  1959. fi
  1960. continue
  1961. ;;
  1962. prog)
  1963. if test "$pass" != link; then
  1964. deplibs="$deplib $deplibs"
  1965. else
  1966. compile_deplibs="$deplib $compile_deplibs"
  1967. finalize_deplibs="$deplib $finalize_deplibs"
  1968. fi
  1969. continue
  1970. ;;
  1971. esac # linkmode
  1972. ;; # *.$libext
  1973. *.lo | *.$objext)
  1974. if test "$pass" = conv; then
  1975. deplibs="$deplib $deplibs"
  1976. elif test "$linkmode" = prog; then
  1977. if test "$pass" = dlpreopen || test "$dlopen_support" != yes || test "$build_libtool_libs" = no; then
  1978. # If there is no dlopen support or we're linking statically,
  1979. # we need to preload.
  1980. newdlprefiles="$newdlprefiles $deplib"
  1981. compile_deplibs="$deplib $compile_deplibs"
  1982. finalize_deplibs="$deplib $finalize_deplibs"
  1983. else
  1984. newdlfiles="$newdlfiles $deplib"
  1985. fi
  1986. fi
  1987. continue
  1988. ;;
  1989. %DEPLIBS%)
  1990. alldeplibs=yes
  1991. continue
  1992. ;;
  1993. esac # case $deplib
  1994. if test "$found" = yes || test -f "$lib"; then :
  1995. else
  1996. $echo "$modename: cannot find the library \`$lib'" 1>&2
  1997. exit $EXIT_FAILURE
  1998. fi
  1999. # Check to see that this really is a libtool archive.
  2000. if (${SED} -e '2q' $lib | grep "^# Generated by .*$PACKAGE") >/dev/null 2>&1; then :
  2001. else
  2002. $echo "$modename: \`$lib' is not a valid libtool archive" 1>&2
  2003. exit $EXIT_FAILURE
  2004. fi
  2005. ladir=`$echo "X$lib" | $Xsed -e 's%/[^/]*$%%'`
  2006. test "X$ladir" = "X$lib" && ladir="."
  2007. dlname=
  2008. dlopen=
  2009. dlpreopen=
  2010. libdir=
  2011. library_names=
  2012. old_library=
  2013. # If the library was installed with an old release of libtool,
  2014. # it will not redefine variables installed, or shouldnotlink
  2015. installed=yes
  2016. shouldnotlink=no
  2017. avoidtemprpath=
  2018. # Read the .la file
  2019. case $lib in
  2020. */* | *\\*) . $lib ;;
  2021. *) . ./$lib ;;
  2022. esac
  2023. if test "$linkmode,$pass" = "lib,link" ||
  2024. test "$linkmode,$pass" = "prog,scan" ||
  2025. { test "$linkmode" != prog && test "$linkmode" != lib; }; then
  2026. test -n "$dlopen" && dlfiles="$dlfiles $dlopen"
  2027. test -n "$dlpreopen" && dlprefiles="$dlprefiles $dlpreopen"
  2028. fi
  2029. if test "$pass" = conv; then
  2030. # Only check for convenience libraries
  2031. deplibs="$lib $deplibs"
  2032. if test -z "$libdir"; then
  2033. if test -z "$old_library"; then
  2034. $echo "$modename: cannot find name of link library for \`$lib'" 1>&2
  2035. exit $EXIT_FAILURE
  2036. fi
  2037. # It is a libtool convenience library, so add in its objects.
  2038. convenience="$convenience $ladir/$objdir/$old_library"
  2039. old_convenience="$old_convenience $ladir/$objdir/$old_library"
  2040. tmp_libs=
  2041. for deplib in $dependency_libs; do
  2042. deplibs="$deplib $deplibs"
  2043. if test "X$duplicate_deps" = "Xyes" ; then
  2044. case "$tmp_libs " in
  2045. *" $deplib "*) specialdeplibs="$specialdeplibs $deplib" ;;
  2046. esac
  2047. fi
  2048. tmp_libs="$tmp_libs $deplib"
  2049. done
  2050. elif test "$linkmode" != prog && test "$linkmode" != lib; then
  2051. $echo "$modename: \`$lib' is not a convenience library" 1>&2
  2052. exit $EXIT_FAILURE
  2053. fi
  2054. continue
  2055. fi # $pass = conv
  2056. # Get the name of the library we link against.
  2057. linklib=
  2058. for l in $old_library $library_names; do
  2059. linklib="$l"
  2060. done
  2061. if test -z "$linklib"; then
  2062. $echo "$modename: cannot find name of link library for \`$lib'" 1>&2
  2063. exit $EXIT_FAILURE
  2064. fi
  2065. # This library was specified with -dlopen.
  2066. if test "$pass" = dlopen; then
  2067. if test -z "$libdir"; then
  2068. $echo "$modename: cannot -dlopen a convenience library: \`$lib'" 1>&2
  2069. exit $EXIT_FAILURE
  2070. fi
  2071. if test -z "$dlname" ||
  2072. test "$dlopen_support" != yes ||
  2073. test "$build_libtool_libs" = no; then
  2074. # If there is no dlname, no dlopen support or we're linking
  2075. # statically, we need to preload. We also need to preload any
  2076. # dependent libraries so libltdl's deplib preloader doesn't
  2077. # bomb out in the load deplibs phase.
  2078. dlprefiles="$dlprefiles $lib $dependency_libs"
  2079. else
  2080. newdlfiles="$newdlfiles $lib"
  2081. fi
  2082. continue
  2083. fi # $pass = dlopen
  2084. # We need an absolute path.
  2085. case $ladir in
  2086. [\\/]* | [A-Za-z]:[\\/]*) abs_ladir="$ladir" ;;
  2087. *)
  2088. abs_ladir=`cd "$ladir" && pwd`
  2089. if test -z "$abs_ladir"; then
  2090. $echo "$modename: warning: cannot determine absolute directory name of \`$ladir'" 1>&2
  2091. $echo "$modename: passing it literally to the linker, although it might fail" 1>&2
  2092. abs_ladir="$ladir"
  2093. fi
  2094. ;;
  2095. esac
  2096. laname=`$echo "X$lib" | $Xsed -e 's%^.*/%%'`
  2097. # Find the relevant object directory and library name.
  2098. if test "X$installed" = Xyes; then
  2099. if test ! -f "$libdir/$linklib" && test -f "$abs_ladir/$linklib"; then
  2100. $echo "$modename: warning: library \`$lib' was moved." 1>&2
  2101. dir="$ladir"
  2102. absdir="$abs_ladir"
  2103. libdir="$abs_ladir"
  2104. else
  2105. dir="$libdir"
  2106. absdir="$libdir"
  2107. fi
  2108. test "X$hardcode_automatic" = Xyes && avoidtemprpath=yes
  2109. else
  2110. if test ! -f "$ladir/$objdir/$linklib" && test -f "$abs_ladir/$linklib"; then
  2111. dir="$ladir"
  2112. absdir="$abs_ladir"
  2113. # Remove this search path later
  2114. notinst_path="$notinst_path $abs_ladir"
  2115. else
  2116. dir="$ladir/$objdir"
  2117. absdir="$abs_ladir/$objdir"
  2118. # Remove this search path later
  2119. notinst_path="$notinst_path $abs_ladir"
  2120. fi
  2121. fi # $installed = yes
  2122. name=`$echo "X$laname" | $Xsed -e 's/\.la$//' -e 's/^lib//'`
  2123. # This library was specified with -dlpreopen.
  2124. if test "$pass" = dlpreopen; then
  2125. if test -z "$libdir"; then
  2126. $echo "$modename: cannot -dlpreopen a convenience library: \`$lib'" 1>&2
  2127. exit $EXIT_FAILURE
  2128. fi
  2129. # Prefer using a static library (so that no silly _DYNAMIC symbols
  2130. # are required to link).
  2131. if test -n "$old_library"; then
  2132. newdlprefiles="$newdlprefiles $dir/$old_library"
  2133. # Otherwise, use the dlname, so that lt_dlopen finds it.
  2134. elif test -n "$dlname"; then
  2135. newdlprefiles="$newdlprefiles $dir/$dlname"
  2136. else
  2137. newdlprefiles="$newdlprefiles $dir/$linklib"
  2138. fi
  2139. fi # $pass = dlpreopen
  2140. if test -z "$libdir"; then
  2141. # Link the convenience library
  2142. if test "$linkmode" = lib; then
  2143. deplibs="$dir/$old_library $deplibs"
  2144. elif test "$linkmode,$pass" = "prog,link"; then
  2145. compile_deplibs="$dir/$old_library $compile_deplibs"
  2146. finalize_deplibs="$dir/$old_library $finalize_deplibs"
  2147. else
  2148. deplibs="$lib $deplibs" # used for prog,scan pass
  2149. fi
  2150. continue
  2151. fi
  2152. if test "$linkmode" = prog && test "$pass" != link; then
  2153. newlib_search_path="$newlib_search_path $ladir"
  2154. deplibs="$lib $deplibs"
  2155. linkalldeplibs=no
  2156. if test "$link_all_deplibs" != no || test -z "$library_names" ||
  2157. test "$build_libtool_libs" = no; then
  2158. linkalldeplibs=yes
  2159. fi
  2160. tmp_libs=
  2161. for deplib in $dependency_libs; do
  2162. case $deplib in
  2163. -L*) newlib_search_path="$newlib_search_path "`$echo "X$deplib" | $Xsed -e 's/^-L//'`;; ### testsuite: skip nested quoting test
  2164. esac
  2165. # Need to link against all dependency_libs?
  2166. if test "$linkalldeplibs" = yes; then
  2167. deplibs="$deplib $deplibs"
  2168. else
  2169. # Need to hardcode shared library paths
  2170. # or/and link against static libraries
  2171. newdependency_libs="$deplib $newdependency_libs"
  2172. fi
  2173. if test "X$duplicate_deps" = "Xyes" ; then
  2174. case "$tmp_libs " in
  2175. *" $deplib "*) specialdeplibs="$specialdeplibs $deplib" ;;
  2176. esac
  2177. fi
  2178. tmp_libs="$tmp_libs $deplib"
  2179. done # for deplib
  2180. continue
  2181. fi # $linkmode = prog...
  2182. if test "$linkmode,$pass" = "prog,link"; then
  2183. if test -n "$library_names" &&
  2184. { test "$prefer_static_libs" = no || test -z "$old_library"; }; then
  2185. # We need to hardcode the library path
  2186. if test -n "$shlibpath_var" && test -z "$avoidtemprpath" ; then
  2187. # Make sure the rpath contains only unique directories.
  2188. case "$temp_rpath " in
  2189. *" $dir "*) ;;
  2190. *" $absdir "*) ;;
  2191. *) temp_rpath="$temp_rpath $dir" ;;
  2192. esac
  2193. fi
  2194. # Hardcode the library path.
  2195. # Skip directories that are in the system default run-time
  2196. # search path.
  2197. case " $sys_lib_dlsearch_path " in
  2198. *" $absdir "*) ;;
  2199. *)
  2200. case "$compile_rpath " in
  2201. *" $absdir "*) ;;
  2202. *) compile_rpath="$compile_rpath $absdir"
  2203. esac
  2204. ;;
  2205. esac
  2206. case " $sys_lib_dlsearch_path " in
  2207. *" $libdir "*) ;;
  2208. *)
  2209. case "$finalize_rpath " in
  2210. *" $libdir "*) ;;
  2211. *) finalize_rpath="$finalize_rpath $libdir"
  2212. esac
  2213. ;;
  2214. esac
  2215. fi # $linkmode,$pass = prog,link...
  2216. if test "$alldeplibs" = yes &&
  2217. { test "$deplibs_check_method" = pass_all ||
  2218. { test "$build_libtool_libs" = yes &&
  2219. test -n "$library_names"; }; }; then
  2220. # We only need to search for static libraries
  2221. continue
  2222. fi
  2223. fi
  2224. link_static=no # Whether the deplib will be linked statically
  2225. if test -n "$library_names" &&
  2226. { test "$prefer_static_libs" = no || test -z "$old_library"; }; then
  2227. if test "$installed" = no; then
  2228. notinst_deplibs="$notinst_deplibs $lib"
  2229. need_relink=yes
  2230. fi
  2231. # This is a shared library
  2232. # Warn about portability, can't link against -module's on
  2233. # some systems (darwin)
  2234. if test "$shouldnotlink" = yes && test "$pass" = link ; then
  2235. $echo
  2236. if test "$linkmode" = prog; then
  2237. $echo "*** Warning: Linking the executable $output against the loadable module"
  2238. else
  2239. $echo "*** Warning: Linking the shared library $output against the loadable module"
  2240. fi
  2241. $echo "*** $linklib is not portable!"
  2242. fi
  2243. if test "$linkmode" = lib &&
  2244. test "$hardcode_into_libs" = yes; then
  2245. # Hardcode the library path.
  2246. # Skip directories that are in the system default run-time
  2247. # search path.
  2248. case " $sys_lib_dlsearch_path " in
  2249. *" $absdir "*) ;;
  2250. *)
  2251. case "$compile_rpath " in
  2252. *" $absdir "*) ;;
  2253. *) compile_rpath="$compile_rpath $absdir"
  2254. esac
  2255. ;;
  2256. esac
  2257. case " $sys_lib_dlsearch_path " in
  2258. *" $libdir "*) ;;
  2259. *)
  2260. case "$finalize_rpath " in
  2261. *" $libdir "*) ;;
  2262. *) finalize_rpath="$finalize_rpath $libdir"
  2263. esac
  2264. ;;
  2265. esac
  2266. fi
  2267. if test -n "$old_archive_from_expsyms_cmds"; then
  2268. # figure out the soname
  2269. set dummy $library_names
  2270. realname="$2"
  2271. shift; shift
  2272. libname=`eval \\$echo \"$libname_spec\"`
  2273. # use dlname if we got it. it's perfectly good, no?
  2274. if test -n "$dlname"; then
  2275. soname="$dlname"
  2276. elif test -n "$soname_spec"; then
  2277. # bleh windows
  2278. case $host in
  2279. *cygwin* | mingw*)
  2280. major=`expr $current - $age`
  2281. versuffix="-$major"
  2282. ;;
  2283. esac
  2284. eval soname=\"$soname_spec\"
  2285. else
  2286. soname="$realname"
  2287. fi
  2288. # Make a new name for the extract_expsyms_cmds to use
  2289. soroot="$soname"
  2290. soname=`$echo $soroot | ${SED} -e 's/^.*\///'`
  2291. newlib="libimp-`$echo $soname | ${SED} 's/^lib//;s/\.dll$//'`.a"
  2292. # If the library has no export list, then create one now
  2293. if test -f "$output_objdir/$soname-def"; then :
  2294. else
  2295. $show "extracting exported symbol list from \`$soname'"
  2296. save_ifs="$IFS"; IFS='~'
  2297. cmds=$extract_expsyms_cmds
  2298. for cmd in $cmds; do
  2299. IFS="$save_ifs"
  2300. eval cmd=\"$cmd\"
  2301. $show "$cmd"
  2302. $run eval "$cmd" || exit $?
  2303. done
  2304. IFS="$save_ifs"
  2305. fi
  2306. # Create $newlib
  2307. if test -f "$output_objdir/$newlib"; then :; else
  2308. $show "generating import library for \`$soname'"
  2309. save_ifs="$IFS"; IFS='~'
  2310. cmds=$old_archive_from_expsyms_cmds
  2311. for cmd in $cmds; do
  2312. IFS="$save_ifs"
  2313. eval cmd=\"$cmd\"
  2314. $show "$cmd"
  2315. $run eval "$cmd" || exit $?
  2316. done
  2317. IFS="$save_ifs"
  2318. fi
  2319. # make sure the library variables are pointing to the new library
  2320. dir=$output_objdir
  2321. linklib=$newlib
  2322. fi # test -n "$old_archive_from_expsyms_cmds"
  2323. if test "$linkmode" = prog || test "$mode" != relink; then
  2324. add_shlibpath=
  2325. add_dir=
  2326. add=
  2327. lib_linked=yes
  2328. case $hardcode_action in
  2329. immediate | unsupported)
  2330. if test "$hardcode_direct" = no; then
  2331. add="$dir/$linklib"
  2332. case $host in
  2333. *-*-sco3.2v5* ) add_dir="-L$dir" ;;
  2334. *-*-darwin* )
  2335. # if the lib is a module then we can not link against
  2336. # it, someone is ignoring the new warnings I added
  2337. if /usr/bin/file -L $add 2> /dev/null | $EGREP "bundle" >/dev/null ; then
  2338. $echo "** Warning, lib $linklib is a module, not a shared library"
  2339. if test -z "$old_library" ; then
  2340. $echo
  2341. $echo "** And there doesn't seem to be a static archive available"
  2342. $echo "** The link will probably fail, sorry"
  2343. else
  2344. add="$dir/$old_library"
  2345. fi
  2346. fi
  2347. esac
  2348. elif test "$hardcode_minus_L" = no; then
  2349. case $host in
  2350. *-*-sunos*) add_shlibpath="$dir" ;;
  2351. esac
  2352. add_dir="-L$dir"
  2353. add="-l$name"
  2354. elif test "$hardcode_shlibpath_var" = no; then
  2355. add_shlibpath="$dir"
  2356. add="-l$name"
  2357. else
  2358. lib_linked=no
  2359. fi
  2360. ;;
  2361. relink)
  2362. if test "$hardcode_direct" = yes; then
  2363. add="$dir/$linklib"
  2364. elif test "$hardcode_minus_L" = yes; then
  2365. add_dir="-L$dir"
  2366. # Try looking first in the location we're being installed to.
  2367. if test -n "$inst_prefix_dir"; then
  2368. case "$libdir" in
  2369. [\\/]*)
  2370. add_dir="$add_dir -L$inst_prefix_dir$libdir"
  2371. ;;
  2372. esac
  2373. fi
  2374. add="-l$name"
  2375. elif test "$hardcode_shlibpath_var" = yes; then
  2376. add_shlibpath="$dir"
  2377. add="-l$name"
  2378. else
  2379. lib_linked=no
  2380. fi
  2381. ;;
  2382. *) lib_linked=no ;;
  2383. esac
  2384. if test "$lib_linked" != yes; then
  2385. $echo "$modename: configuration error: unsupported hardcode properties"
  2386. exit $EXIT_FAILURE
  2387. fi
  2388. if test -n "$add_shlibpath"; then
  2389. case :$compile_shlibpath: in
  2390. *":$add_shlibpath:"*) ;;
  2391. *) compile_shlibpath="$compile_shlibpath$add_shlibpath:" ;;
  2392. esac
  2393. fi
  2394. if test "$linkmode" = prog; then
  2395. test -n "$add_dir" && compile_deplibs="$add_dir $compile_deplibs"
  2396. test -n "$add" && compile_deplibs="$add $compile_deplibs"
  2397. else
  2398. test -n "$add_dir" && deplibs="$add_dir $deplibs"
  2399. test -n "$add" && deplibs="$add $deplibs"
  2400. if test "$hardcode_direct" != yes && \
  2401. test "$hardcode_minus_L" != yes && \
  2402. test "$hardcode_shlibpath_var" = yes; then
  2403. case :$finalize_shlibpath: in
  2404. *":$libdir:"*) ;;
  2405. *) finalize_shlibpath="$finalize_shlibpath$libdir:" ;;
  2406. esac
  2407. fi
  2408. fi
  2409. fi
  2410. if test "$linkmode" = prog || test "$mode" = relink; then
  2411. add_shlibpath=
  2412. add_dir=
  2413. add=
  2414. # Finalize command for both is simple: just hardcode it.
  2415. if test "$hardcode_direct" = yes; then
  2416. add="$libdir/$linklib"
  2417. elif test "$hardcode_minus_L" = yes; then
  2418. add_dir="-L$libdir"
  2419. add="-l$name"
  2420. elif test "$hardcode_shlibpath_var" = yes; then
  2421. case :$finalize_shlibpath: in
  2422. *":$libdir:"*) ;;
  2423. *) finalize_shlibpath="$finalize_shlibpath$libdir:" ;;
  2424. esac
  2425. add="-l$name"
  2426. elif test "$hardcode_automatic" = yes; then
  2427. if test -n "$inst_prefix_dir" &&
  2428. test -f "$inst_prefix_dir$libdir/$linklib" ; then
  2429. add="$inst_prefix_dir$libdir/$linklib"
  2430. else
  2431. add="$libdir/$linklib"
  2432. fi
  2433. else
  2434. # We cannot seem to hardcode it, guess we'll fake it.
  2435. add_dir="-L$libdir"
  2436. # Try looking first in the location we're being installed to.
  2437. if test -n "$inst_prefix_dir"; then
  2438. case "$libdir" in
  2439. [\\/]*)
  2440. add_dir="$add_dir -L$inst_prefix_dir$libdir"
  2441. ;;
  2442. esac
  2443. fi
  2444. add="-l$name"
  2445. fi
  2446. if test "$linkmode" = prog; then
  2447. test -n "$add_dir" && finalize_deplibs="$add_dir $finalize_deplibs"
  2448. test -n "$add" && finalize_deplibs="$add $finalize_deplibs"
  2449. else
  2450. test -n "$add_dir" && deplibs="$add_dir $deplibs"
  2451. test -n "$add" && deplibs="$add $deplibs"
  2452. fi
  2453. fi
  2454. elif test "$linkmode" = prog; then
  2455. # Here we assume that one of hardcode_direct or hardcode_minus_L
  2456. # is not unsupported. This is valid on all known static and
  2457. # shared platforms.
  2458. if test "$hardcode_direct" != unsupported; then
  2459. test -n "$old_library" && linklib="$old_library"
  2460. compile_deplibs="$dir/$linklib $compile_deplibs"
  2461. finalize_deplibs="$dir/$linklib $finalize_deplibs"
  2462. else
  2463. compile_deplibs="-l$name -L$dir $compile_deplibs"
  2464. finalize_deplibs="-l$name -L$dir $finalize_deplibs"
  2465. fi
  2466. elif test "$build_libtool_libs" = yes; then
  2467. # Not a shared library
  2468. if test "$deplibs_check_method" != pass_all; then
  2469. # We're trying link a shared library against a static one
  2470. # but the system doesn't support it.
  2471. # Just print a warning and add the library to dependency_libs so
  2472. # that the program can be linked against the static library.
  2473. $echo
  2474. $echo "*** Warning: This system can not link to static lib archive $lib."
  2475. $echo "*** I have the capability to make that library automatically link in when"
  2476. $echo "*** you link to this library. But I can only do this if you have a"
  2477. $echo "*** shared version of the library, which you do not appear to have."
  2478. if test "$module" = yes; then
  2479. $echo "*** But as you try to build a module library, libtool will still create "
  2480. $echo "*** a static module, that should work as long as the dlopening application"
  2481. $echo "*** is linked with the -dlopen flag to resolve symbols at runtime."
  2482. if test -z "$global_symbol_pipe"; then
  2483. $echo
  2484. $echo "*** However, this would only work if libtool was able to extract symbol"
  2485. $echo "*** lists from a program, using \`nm' or equivalent, but libtool could"
  2486. $echo "*** not find such a program. So, this module is probably useless."
  2487. $echo "*** \`nm' from GNU binutils and a full rebuild may help."
  2488. fi
  2489. if test "$build_old_libs" = no; then
  2490. build_libtool_libs=module
  2491. build_old_libs=yes
  2492. else
  2493. build_libtool_libs=no
  2494. fi
  2495. fi
  2496. else
  2497. convenience="$convenience $dir/$old_library"
  2498. old_convenience="$old_convenience $dir/$old_library"
  2499. deplibs="$dir/$old_library $deplibs"
  2500. link_static=yes
  2501. fi
  2502. fi # link shared/static library?
  2503. if test "$linkmode" = lib; then
  2504. if test -n "$dependency_libs" &&
  2505. { test "$hardcode_into_libs" != yes ||
  2506. test "$build_old_libs" = yes ||
  2507. test "$link_static" = yes; }; then
  2508. # Extract -R from dependency_libs
  2509. temp_deplibs=
  2510. for libdir in $dependency_libs; do
  2511. case $libdir in
  2512. -R*) temp_xrpath=`$echo "X$libdir" | $Xsed -e 's/^-R//'`
  2513. case " $xrpath " in
  2514. *" $temp_xrpath "*) ;;
  2515. *) xrpath="$xrpath $temp_xrpath";;
  2516. esac;;
  2517. *) temp_deplibs="$temp_deplibs $libdir";;
  2518. esac
  2519. done
  2520. dependency_libs="$temp_deplibs"
  2521. fi
  2522. newlib_search_path="$newlib_search_path $absdir"
  2523. # Link against this library
  2524. test "$link_static" = no && newdependency_libs="$abs_ladir/$laname $newdependency_libs"
  2525. # ... and its dependency_libs
  2526. tmp_libs=
  2527. for deplib in $dependency_libs; do
  2528. newdependency_libs="$deplib $newdependency_libs"
  2529. if test "X$duplicate_deps" = "Xyes" ; then
  2530. case "$tmp_libs " in
  2531. *" $deplib "*) specialdeplibs="$specialdeplibs $deplib" ;;
  2532. esac
  2533. fi
  2534. tmp_libs="$tmp_libs $deplib"
  2535. done
  2536. if test "$link_all_deplibs" != no; then
  2537. # Add the search paths of all dependency libraries
  2538. for deplib in $dependency_libs; do
  2539. case $deplib in
  2540. -L*) path="$deplib" ;;
  2541. *.la)
  2542. dir=`$echo "X$deplib" | $Xsed -e 's%/[^/]*$%%'`
  2543. test "X$dir" = "X$deplib" && dir="."
  2544. # We need an absolute path.
  2545. case $dir in
  2546. [\\/]* | [A-Za-z]:[\\/]*) absdir="$dir" ;;
  2547. *)
  2548. absdir=`cd "$dir" && pwd`
  2549. if test -z "$absdir"; then
  2550. $echo "$modename: warning: cannot determine absolute directory name of \`$dir'" 1>&2
  2551. absdir="$dir"
  2552. fi
  2553. ;;
  2554. esac
  2555. if grep "^installed=no" $deplib > /dev/null; then
  2556. path="$absdir/$objdir"
  2557. else
  2558. eval libdir=`${SED} -n -e 's/^libdir=\(.*\)$/\1/p' $deplib`
  2559. if test -z "$libdir"; then
  2560. $echo "$modename: \`$deplib' is not a valid libtool archive" 1>&2
  2561. exit $EXIT_FAILURE
  2562. fi
  2563. if test "$absdir" != "$libdir"; then
  2564. $echo "$modename: warning: \`$deplib' seems to be moved" 1>&2
  2565. fi
  2566. path="$absdir"
  2567. fi
  2568. depdepl=
  2569. case $host in
  2570. *-*-darwin*)
  2571. # we do not want to link against static libs,
  2572. # but need to link against shared
  2573. eval deplibrary_names=`${SED} -n -e 's/^library_names=\(.*\)$/\1/p' $deplib`
  2574. if test -n "$deplibrary_names" ; then
  2575. for tmp in $deplibrary_names ; do
  2576. depdepl=$tmp
  2577. done
  2578. if test -f "$path/$depdepl" ; then
  2579. depdepl="$path/$depdepl"
  2580. fi
  2581. # do not add paths which are already there
  2582. case " $newlib_search_path " in
  2583. *" $path "*) ;;
  2584. *) newlib_search_path="$newlib_search_path $path";;
  2585. esac
  2586. fi
  2587. path=""
  2588. ;;
  2589. *)
  2590. path="-L$path"
  2591. ;;
  2592. esac
  2593. ;;
  2594. -l*)
  2595. case $host in
  2596. *-*-darwin*)
  2597. # Again, we only want to link against shared libraries
  2598. eval tmp_libs=`$echo "X$deplib" | $Xsed -e "s,^\-l,,"`
  2599. for tmp in $newlib_search_path ; do
  2600. if test -f "$tmp/lib$tmp_libs.dylib" ; then
  2601. eval depdepl="$tmp/lib$tmp_libs.dylib"
  2602. break
  2603. fi
  2604. done
  2605. path=""
  2606. ;;
  2607. *) continue ;;
  2608. esac
  2609. ;;
  2610. *) continue ;;
  2611. esac
  2612. case " $deplibs " in
  2613. *" $depdepl "*) ;;
  2614. *) deplibs="$depdepl $deplibs" ;;
  2615. esac
  2616. case " $deplibs " in
  2617. *" $path "*) ;;
  2618. *) deplibs="$deplibs $path" ;;
  2619. esac
  2620. done
  2621. fi # link_all_deplibs != no
  2622. fi # linkmode = lib
  2623. done # for deplib in $libs
  2624. dependency_libs="$newdependency_libs"
  2625. if test "$pass" = dlpreopen; then
  2626. # Link the dlpreopened libraries before other libraries
  2627. for deplib in $save_deplibs; do
  2628. deplibs="$deplib $deplibs"
  2629. done
  2630. fi
  2631. if test "$pass" != dlopen; then
  2632. if test "$pass" != conv; then
  2633. # Make sure lib_search_path contains only unique directories.
  2634. lib_search_path=
  2635. for dir in $newlib_search_path; do
  2636. case "$lib_search_path " in
  2637. *" $dir "*) ;;
  2638. *) lib_search_path="$lib_search_path $dir" ;;
  2639. esac
  2640. done
  2641. newlib_search_path=
  2642. fi
  2643. if test "$linkmode,$pass" != "prog,link"; then
  2644. vars="deplibs"
  2645. else
  2646. vars="compile_deplibs finalize_deplibs"
  2647. fi
  2648. for var in $vars dependency_libs; do
  2649. # Add libraries to $var in reverse order
  2650. eval tmp_libs=\"\$$var\"
  2651. new_libs=
  2652. for deplib in $tmp_libs; do
  2653. # FIXME: Pedantically, this is the right thing to do, so
  2654. # that some nasty dependency loop isn't accidentally
  2655. # broken:
  2656. #new_libs="$deplib $new_libs"
  2657. # Pragmatically, this seems to cause very few problems in
  2658. # practice:
  2659. case $deplib in
  2660. -L*) new_libs="$deplib $new_libs" ;;
  2661. -R*) ;;
  2662. *)
  2663. # And here is the reason: when a library appears more
  2664. # than once as an explicit dependence of a library, or
  2665. # is implicitly linked in more than once by the
  2666. # compiler, it is considered special, and multiple
  2667. # occurrences thereof are not removed. Compare this
  2668. # with having the same library being listed as a
  2669. # dependency of multiple other libraries: in this case,
  2670. # we know (pedantically, we assume) the library does not
  2671. # need to be listed more than once, so we keep only the
  2672. # last copy. This is not always right, but it is rare
  2673. # enough that we require users that really mean to play
  2674. # such unportable linking tricks to link the library
  2675. # using -Wl,-lname, so that libtool does not consider it
  2676. # for duplicate removal.
  2677. case " $specialdeplibs " in
  2678. *" $deplib "*) new_libs="$deplib $new_libs" ;;
  2679. *)
  2680. case " $new_libs " in
  2681. *" $deplib "*) ;;
  2682. *) new_libs="$deplib $new_libs" ;;
  2683. esac
  2684. ;;
  2685. esac
  2686. ;;
  2687. esac
  2688. done
  2689. tmp_libs=
  2690. for deplib in $new_libs; do
  2691. case $deplib in
  2692. -L*)
  2693. case " $tmp_libs " in
  2694. *" $deplib "*) ;;
  2695. *) tmp_libs="$tmp_libs $deplib" ;;
  2696. esac
  2697. ;;
  2698. *) tmp_libs="$tmp_libs $deplib" ;;
  2699. esac
  2700. done
  2701. eval $var=\"$tmp_libs\"
  2702. done # for var
  2703. fi
  2704. # Last step: remove runtime libs from dependency_libs
  2705. # (they stay in deplibs)
  2706. tmp_libs=
  2707. for i in $dependency_libs ; do
  2708. case " $predeps $postdeps $compiler_lib_search_path " in
  2709. *" $i "*)
  2710. i=""
  2711. ;;
  2712. esac
  2713. if test -n "$i" ; then
  2714. tmp_libs="$tmp_libs $i"
  2715. fi
  2716. done
  2717. dependency_libs=$tmp_libs
  2718. done # for pass
  2719. if test "$linkmode" = prog; then
  2720. dlfiles="$newdlfiles"
  2721. dlprefiles="$newdlprefiles"
  2722. fi
  2723. case $linkmode in
  2724. oldlib)
  2725. if test -n "$deplibs"; then
  2726. $echo "$modename: warning: \`-l' and \`-L' are ignored for archives" 1>&2
  2727. fi
  2728. if test -n "$dlfiles$dlprefiles" || test "$dlself" != no; then
  2729. $echo "$modename: warning: \`-dlopen' is ignored for archives" 1>&2
  2730. fi
  2731. if test -n "$rpath"; then
  2732. $echo "$modename: warning: \`-rpath' is ignored for archives" 1>&2
  2733. fi
  2734. if test -n "$xrpath"; then
  2735. $echo "$modename: warning: \`-R' is ignored for archives" 1>&2
  2736. fi
  2737. if test -n "$vinfo"; then
  2738. $echo "$modename: warning: \`-version-info/-version-number' is ignored for archives" 1>&2
  2739. fi
  2740. if test -n "$release"; then
  2741. $echo "$modename: warning: \`-release' is ignored for archives" 1>&2
  2742. fi
  2743. if test -n "$export_symbols" || test -n "$export_symbols_regex"; then
  2744. $echo "$modename: warning: \`-export-symbols' is ignored for archives" 1>&2
  2745. fi
  2746. # Now set the variables for building old libraries.
  2747. build_libtool_libs=no
  2748. oldlibs="$output"
  2749. objs="$objs$old_deplibs"
  2750. ;;
  2751. lib)
  2752. # Make sure we only generate libraries of the form `libNAME.la'.
  2753. case $outputname in
  2754. lib*)
  2755. name=`$echo "X$outputname" | $Xsed -e 's/\.la$//' -e 's/^lib//'`
  2756. eval shared_ext=\"$shrext_cmds\"
  2757. eval libname=\"$libname_spec\"
  2758. ;;
  2759. *)
  2760. if test "$module" = no; then
  2761. $echo "$modename: libtool library \`$output' must begin with \`lib'" 1>&2
  2762. $echo "$help" 1>&2
  2763. exit $EXIT_FAILURE
  2764. fi
  2765. if test "$need_lib_prefix" != no; then
  2766. # Add the "lib" prefix for modules if required
  2767. name=`$echo "X$outputname" | $Xsed -e 's/\.la$//'`
  2768. eval shared_ext=\"$shrext_cmds\"
  2769. eval libname=\"$libname_spec\"
  2770. else
  2771. libname=`$echo "X$outputname" | $Xsed -e 's/\.la$//'`
  2772. fi
  2773. ;;
  2774. esac
  2775. if test -n "$objs"; then
  2776. if test "$deplibs_check_method" != pass_all; then
  2777. $echo "$modename: cannot build libtool library \`$output' from non-libtool objects on this host:$objs" 2>&1
  2778. exit $EXIT_FAILURE
  2779. else
  2780. $echo
  2781. $echo "*** Warning: Linking the shared library $output against the non-libtool"
  2782. $echo "*** objects $objs is not portable!"
  2783. libobjs="$libobjs $objs"
  2784. fi
  2785. fi
  2786. if test "$dlself" != no; then
  2787. $echo "$modename: warning: \`-dlopen self' is ignored for libtool libraries" 1>&2
  2788. fi
  2789. set dummy $rpath
  2790. if test "$#" -gt 2; then
  2791. $echo "$modename: warning: ignoring multiple \`-rpath's for a libtool library" 1>&2
  2792. fi
  2793. install_libdir="$2"
  2794. oldlibs=
  2795. if test -z "$rpath"; then
  2796. if test "$build_libtool_libs" = yes; then
  2797. # Building a libtool convenience library.
  2798. # Some compilers have problems with a `.al' extension so
  2799. # convenience libraries should have the same extension an
  2800. # archive normally would.
  2801. oldlibs="$output_objdir/$libname.$libext $oldlibs"
  2802. build_libtool_libs=convenience
  2803. build_old_libs=yes
  2804. fi
  2805. if test -n "$vinfo"; then
  2806. $echo "$modename: warning: \`-version-info/-version-number' is ignored for convenience libraries" 1>&2
  2807. fi
  2808. if test -n "$release"; then
  2809. $echo "$modename: warning: \`-release' is ignored for convenience libraries" 1>&2
  2810. fi
  2811. else
  2812. # Parse the version information argument.
  2813. save_ifs="$IFS"; IFS=':'
  2814. set dummy $vinfo 0 0 0
  2815. IFS="$save_ifs"
  2816. if test -n "$8"; then
  2817. $echo "$modename: too many parameters to \`-version-info'" 1>&2
  2818. $echo "$help" 1>&2
  2819. exit $EXIT_FAILURE
  2820. fi
  2821. # convert absolute version numbers to libtool ages
  2822. # this retains compatibility with .la files and attempts
  2823. # to make the code below a bit more comprehensible
  2824. case $vinfo_number in
  2825. yes)
  2826. number_major="$2"
  2827. number_minor="$3"
  2828. number_revision="$4"
  2829. #
  2830. # There are really only two kinds -- those that
  2831. # use the current revision as the major version
  2832. # and those that subtract age and use age as
  2833. # a minor version. But, then there is irix
  2834. # which has an extra 1 added just for fun
  2835. #
  2836. case $version_type in
  2837. darwin|linux|osf|windows)
  2838. current=`expr $number_major + $number_minor`
  2839. age="$number_minor"
  2840. revision="$number_revision"
  2841. ;;
  2842. freebsd-aout|freebsd-elf|sunos)
  2843. current="$number_major"
  2844. revision="$number_minor"
  2845. age="0"
  2846. ;;
  2847. irix|nonstopux)
  2848. current=`expr $number_major + $number_minor - 1`
  2849. age="$number_minor"
  2850. revision="$number_minor"
  2851. ;;
  2852. esac
  2853. ;;
  2854. no)
  2855. current="$2"
  2856. revision="$3"
  2857. age="$4"
  2858. ;;
  2859. esac
  2860. # Check that each of the things are valid numbers.
  2861. case $current in
  2862. 0|[1-9]|[1-9][0-9]|[1-9][0-9][0-9]|[1-9][0-9][0-9][0-9]|[1-9][0-9][0-9][0-9][0-9]) ;;
  2863. *)
  2864. $echo "$modename: CURRENT \`$current' is not a nonnegative integer" 1>&2
  2865. $echo "$modename: \`$vinfo' is not valid version information" 1>&2
  2866. exit $EXIT_FAILURE
  2867. ;;
  2868. esac
  2869. case $revision in
  2870. 0|[1-9]|[1-9][0-9]|[1-9][0-9][0-9]|[1-9][0-9][0-9][0-9]|[1-9][0-9][0-9][0-9][0-9]) ;;
  2871. *)
  2872. $echo "$modename: REVISION \`$revision' is not a nonnegative integer" 1>&2
  2873. $echo "$modename: \`$vinfo' is not valid version information" 1>&2
  2874. exit $EXIT_FAILURE
  2875. ;;
  2876. esac
  2877. case $age in
  2878. 0|[1-9]|[1-9][0-9]|[1-9][0-9][0-9]|[1-9][0-9][0-9][0-9]|[1-9][0-9][0-9][0-9][0-9]) ;;
  2879. *)
  2880. $echo "$modename: AGE \`$age' is not a nonnegative integer" 1>&2
  2881. $echo "$modename: \`$vinfo' is not valid version information" 1>&2
  2882. exit $EXIT_FAILURE
  2883. ;;
  2884. esac
  2885. if test "$age" -gt "$current"; then
  2886. $echo "$modename: AGE \`$age' is greater than the current interface number \`$current'" 1>&2
  2887. $echo "$modename: \`$vinfo' is not valid version information" 1>&2
  2888. exit $EXIT_FAILURE
  2889. fi
  2890. # Calculate the version variables.
  2891. major=
  2892. versuffix=
  2893. verstring=
  2894. case $version_type in
  2895. none) ;;
  2896. darwin)
  2897. # Like Linux, but with the current version available in
  2898. # verstring for coding it into the library header
  2899. major=.`expr $current - $age`
  2900. versuffix="$major.$age.$revision"
  2901. # Darwin ld doesn't like 0 for these options...
  2902. minor_current=`expr $current + 1`
  2903. verstring="${wl}-compatibility_version ${wl}$minor_current ${wl}-current_version ${wl}$minor_current.$revision"
  2904. ;;
  2905. freebsd-aout)
  2906. major=".$current"
  2907. versuffix=".$current.$revision";
  2908. ;;
  2909. freebsd-elf)
  2910. major=".$current"
  2911. versuffix=".$current";
  2912. ;;
  2913. irix | nonstopux)
  2914. major=`expr $current - $age + 1`
  2915. case $version_type in
  2916. nonstopux) verstring_prefix=nonstopux ;;
  2917. *) verstring_prefix=sgi ;;
  2918. esac
  2919. verstring="$verstring_prefix$major.$revision"
  2920. # Add in all the interfaces that we are compatible with.
  2921. loop=$revision
  2922. while test "$loop" -ne 0; do
  2923. iface=`expr $revision - $loop`
  2924. loop=`expr $loop - 1`
  2925. verstring="$verstring_prefix$major.$iface:$verstring"
  2926. done
  2927. # Before this point, $major must not contain `.'.
  2928. major=.$major
  2929. versuffix="$major.$revision"
  2930. ;;
  2931. linux)
  2932. major=.`expr $current - $age`
  2933. versuffix="$major.$age.$revision"
  2934. ;;
  2935. osf)
  2936. major=.`expr $current - $age`
  2937. versuffix=".$current.$age.$revision"
  2938. verstring="$current.$age.$revision"
  2939. # Add in all the interfaces that we are compatible with.
  2940. loop=$age
  2941. while test "$loop" -ne 0; do
  2942. iface=`expr $current - $loop`
  2943. loop=`expr $loop - 1`
  2944. verstring="$verstring:${iface}.0"
  2945. done
  2946. # Make executables depend on our current version.
  2947. verstring="$verstring:${current}.0"
  2948. ;;
  2949. sunos)
  2950. major=".$current"
  2951. versuffix=".$current.$revision"
  2952. ;;
  2953. windows)
  2954. # Use '-' rather than '.', since we only want one
  2955. # extension on DOS 8.3 filesystems.
  2956. major=`expr $current - $age`
  2957. versuffix="-$major"
  2958. ;;
  2959. *)
  2960. $echo "$modename: unknown library version type \`$version_type'" 1>&2
  2961. $echo "Fatal configuration error. See the $PACKAGE docs for more information." 1>&2
  2962. exit $EXIT_FAILURE
  2963. ;;
  2964. esac
  2965. # Clear the version info if we defaulted, and they specified a release.
  2966. if test -z "$vinfo" && test -n "$release"; then
  2967. major=
  2968. case $version_type in
  2969. darwin)
  2970. # we can't check for "0.0" in archive_cmds due to quoting
  2971. # problems, so we reset it completely
  2972. verstring=
  2973. ;;
  2974. *)
  2975. verstring="0.0"
  2976. ;;
  2977. esac
  2978. if test "$need_version" = no; then
  2979. versuffix=
  2980. else
  2981. versuffix=".0.0"
  2982. fi
  2983. fi
  2984. # Remove version info from name if versioning should be avoided
  2985. if test "$avoid_version" = yes && test "$need_version" = no; then
  2986. major=
  2987. versuffix=
  2988. verstring=""
  2989. fi
  2990. # Check to see if the archive will have undefined symbols.
  2991. if test "$allow_undefined" = yes; then
  2992. if test "$allow_undefined_flag" = unsupported; then
  2993. $echo "$modename: warning: undefined symbols not allowed in $host shared libraries" 1>&2
  2994. build_libtool_libs=no
  2995. build_old_libs=yes
  2996. fi
  2997. else
  2998. # Don't allow undefined symbols.
  2999. allow_undefined_flag="$no_undefined_flag"
  3000. fi
  3001. fi
  3002. if test "$mode" != relink; then
  3003. # Remove our outputs, but don't remove object files since they
  3004. # may have been created when compiling PIC objects.
  3005. removelist=
  3006. tempremovelist=`$echo "$output_objdir/*"`
  3007. for p in $tempremovelist; do
  3008. case $p in
  3009. *.$objext)
  3010. ;;
  3011. $output_objdir/$outputname | $output_objdir/$libname.* | $output_objdir/${libname}${release}.*)
  3012. if test "X$precious_files_regex" != "X"; then
  3013. if echo $p | $EGREP -e "$precious_files_regex" >/dev/null 2>&1
  3014. then
  3015. continue
  3016. fi
  3017. fi
  3018. removelist="$removelist $p"
  3019. ;;
  3020. *) ;;
  3021. esac
  3022. done
  3023. if test -n "$removelist"; then
  3024. $show "${rm}r $removelist"
  3025. $run ${rm}r $removelist
  3026. fi
  3027. fi
  3028. # Now set the variables for building old libraries.
  3029. if test "$build_old_libs" = yes && test "$build_libtool_libs" != convenience ; then
  3030. oldlibs="$oldlibs $output_objdir/$libname.$libext"
  3031. # Transform .lo files to .o files.
  3032. oldobjs="$objs "`$echo "X$libobjs" | $SP2NL | $Xsed -e '/\.'${libext}'$/d' -e "$lo2o" | $NL2SP`
  3033. fi
  3034. # Eliminate all temporary directories.
  3035. for path in $notinst_path; do
  3036. lib_search_path=`$echo "$lib_search_path " | ${SED} -e 's% $path % %g'`
  3037. deplibs=`$echo "$deplibs " | ${SED} -e 's% -L$path % %g'`
  3038. dependency_libs=`$echo "$dependency_libs " | ${SED} -e 's% -L$path % %g'`
  3039. done
  3040. if test -n "$xrpath"; then
  3041. # If the user specified any rpath flags, then add them.
  3042. temp_xrpath=
  3043. for libdir in $xrpath; do
  3044. temp_xrpath="$temp_xrpath -R$libdir"
  3045. case "$finalize_rpath " in
  3046. *" $libdir "*) ;;
  3047. *) finalize_rpath="$finalize_rpath $libdir" ;;
  3048. esac
  3049. done
  3050. if test "$hardcode_into_libs" != yes || test "$build_old_libs" = yes; then
  3051. dependency_libs="$temp_xrpath $dependency_libs"
  3052. fi
  3053. fi
  3054. # Make sure dlfiles contains only unique files that won't be dlpreopened
  3055. old_dlfiles="$dlfiles"
  3056. dlfiles=
  3057. for lib in $old_dlfiles; do
  3058. case " $dlprefiles $dlfiles " in
  3059. *" $lib "*) ;;
  3060. *) dlfiles="$dlfiles $lib" ;;
  3061. esac
  3062. done
  3063. # Make sure dlprefiles contains only unique files
  3064. old_dlprefiles="$dlprefiles"
  3065. dlprefiles=
  3066. for lib in $old_dlprefiles; do
  3067. case "$dlprefiles " in
  3068. *" $lib "*) ;;
  3069. *) dlprefiles="$dlprefiles $lib" ;;
  3070. esac
  3071. done
  3072. if test "$build_libtool_libs" = yes; then
  3073. if test -n "$rpath"; then
  3074. case $host in
  3075. *-*-cygwin* | *-*-mingw* | *-*-pw32* | *-*-os2* | *-*-beos*)
  3076. # these systems don't actually have a c library (as such)!
  3077. ;;
  3078. *-*-rhapsody* | *-*-darwin1.[012])
  3079. # Rhapsody C library is in the System framework
  3080. deplibs="$deplibs -framework System"
  3081. ;;
  3082. *-*-netbsd*)
  3083. # Don't link with libc until the a.out ld.so is fixed.
  3084. ;;
  3085. *-*-openbsd* | *-*-freebsd* | *-*-dragonfly*)
  3086. # Do not include libc due to us having libc/libc_r.
  3087. test "X$arg" = "X-lc" && continue
  3088. ;;
  3089. *)
  3090. # Add libc to deplibs on all other systems if necessary.
  3091. if test "$build_libtool_need_lc" = "yes"; then
  3092. deplibs="$deplibs -lc"
  3093. fi
  3094. ;;
  3095. esac
  3096. fi
  3097. # Transform deplibs into only deplibs that can be linked in shared.
  3098. name_save=$name
  3099. libname_save=$libname
  3100. release_save=$release
  3101. versuffix_save=$versuffix
  3102. major_save=$major
  3103. # I'm not sure if I'm treating the release correctly. I think
  3104. # release should show up in the -l (ie -lgmp5) so we don't want to
  3105. # add it in twice. Is that correct?
  3106. release=""
  3107. versuffix=""
  3108. major=""
  3109. newdeplibs=
  3110. droppeddeps=no
  3111. case $deplibs_check_method in
  3112. pass_all)
  3113. # Don't check for shared/static. Everything works.
  3114. # This might be a little naive. We might want to check
  3115. # whether the library exists or not. But this is on
  3116. # osf3 & osf4 and I'm not really sure... Just
  3117. # implementing what was already the behavior.
  3118. newdeplibs=$deplibs
  3119. ;;
  3120. test_compile)
  3121. # This code stresses the "libraries are programs" paradigm to its
  3122. # limits. Maybe even breaks it. We compile a program, linking it
  3123. # against the deplibs as a proxy for the library. Then we can check
  3124. # whether they linked in statically or dynamically with ldd.
  3125. $rm conftest.c
  3126. cat > conftest.c <<EOF
  3127. int main() { return 0; }
  3128. EOF
  3129. $rm conftest
  3130. $LTCC -o conftest conftest.c $deplibs
  3131. if test "$?" -eq 0 ; then
  3132. ldd_output=`ldd conftest`
  3133. for i in $deplibs; do
  3134. name="`expr $i : '-l\(.*\)'`"
  3135. # If $name is empty we are operating on a -L argument.
  3136. if test "$name" != "" && test "$name" -ne "0"; then
  3137. if test "X$allow_libtool_libs_with_static_runtimes" = "Xyes" ; then
  3138. case " $predeps $postdeps " in
  3139. *" $i "*)
  3140. newdeplibs="$newdeplibs $i"
  3141. i=""
  3142. ;;
  3143. esac
  3144. fi
  3145. if test -n "$i" ; then
  3146. libname=`eval \\$echo \"$libname_spec\"`
  3147. deplib_matches=`eval \\$echo \"$library_names_spec\"`
  3148. set dummy $deplib_matches
  3149. deplib_match=$2
  3150. if test `expr "$ldd_output" : ".*$deplib_match"` -ne 0 ; then
  3151. newdeplibs="$newdeplibs $i"
  3152. else
  3153. droppeddeps=yes
  3154. $echo
  3155. $echo "*** Warning: dynamic linker does not accept needed library $i."
  3156. $echo "*** I have the capability to make that library automatically link in when"
  3157. $echo "*** you link to this library. But I can only do this if you have a"
  3158. $echo "*** shared version of the library, which I believe you do not have"
  3159. $echo "*** because a test_compile did reveal that the linker did not use it for"
  3160. $echo "*** its dynamic dependency list that programs get resolved with at runtime."
  3161. fi
  3162. fi
  3163. else
  3164. newdeplibs="$newdeplibs $i"
  3165. fi
  3166. done
  3167. else
  3168. # Error occurred in the first compile. Let's try to salvage
  3169. # the situation: Compile a separate program for each library.
  3170. for i in $deplibs; do
  3171. name="`expr $i : '-l\(.*\)'`"
  3172. # If $name is empty we are operating on a -L argument.
  3173. if test "$name" != "" && test "$name" != "0"; then
  3174. $rm conftest
  3175. $LTCC -o conftest conftest.c $i
  3176. # Did it work?
  3177. if test "$?" -eq 0 ; then
  3178. ldd_output=`ldd conftest`
  3179. if test "X$allow_libtool_libs_with_static_runtimes" = "Xyes" ; then
  3180. case " $predeps $postdeps " in
  3181. *" $i "*)
  3182. newdeplibs="$newdeplibs $i"
  3183. i=""
  3184. ;;
  3185. esac
  3186. fi
  3187. if test -n "$i" ; then
  3188. libname=`eval \\$echo \"$libname_spec\"`
  3189. deplib_matches=`eval \\$echo \"$library_names_spec\"`
  3190. set dummy $deplib_matches
  3191. deplib_match=$2
  3192. if test `expr "$ldd_output" : ".*$deplib_match"` -ne 0 ; then
  3193. newdeplibs="$newdeplibs $i"
  3194. else
  3195. droppeddeps=yes
  3196. $echo
  3197. $echo "*** Warning: dynamic linker does not accept needed library $i."
  3198. $echo "*** I have the capability to make that library automatically link in when"
  3199. $echo "*** you link to this library. But I can only do this if you have a"
  3200. $echo "*** shared version of the library, which you do not appear to have"
  3201. $echo "*** because a test_compile did reveal that the linker did not use this one"
  3202. $echo "*** as a dynamic dependency that programs can get resolved with at runtime."
  3203. fi
  3204. fi
  3205. else
  3206. droppeddeps=yes
  3207. $echo
  3208. $echo "*** Warning! Library $i is needed by this library but I was not able to"
  3209. $echo "*** make it link in! You will probably need to install it or some"
  3210. $echo "*** library that it depends on before this library will be fully"
  3211. $echo "*** functional. Installing it before continuing would be even better."
  3212. fi
  3213. else
  3214. newdeplibs="$newdeplibs $i"
  3215. fi
  3216. done
  3217. fi
  3218. ;;
  3219. file_magic*)
  3220. set dummy $deplibs_check_method
  3221. file_magic_regex=`expr "$deplibs_check_method" : "$2 \(.*\)"`
  3222. for a_deplib in $deplibs; do
  3223. name="`expr $a_deplib : '-l\(.*\)'`"
  3224. # If $name is empty we are operating on a -L argument.
  3225. if test "$name" != "" && test "$name" != "0"; then
  3226. if test "X$allow_libtool_libs_with_static_runtimes" = "Xyes" ; then
  3227. case " $predeps $postdeps " in
  3228. *" $a_deplib "*)
  3229. newdeplibs="$newdeplibs $a_deplib"
  3230. a_deplib=""
  3231. ;;
  3232. esac
  3233. fi
  3234. if test -n "$a_deplib" ; then
  3235. libname=`eval \\$echo \"$libname_spec\"`
  3236. for i in $lib_search_path $sys_lib_search_path $shlib_search_path; do
  3237. potential_libs=`ls $i/$libname[.-]* 2>/dev/null`
  3238. for potent_lib in $potential_libs; do
  3239. # Follow soft links.
  3240. if ls -lLd "$potent_lib" 2>/dev/null \
  3241. | grep " -> " >/dev/null; then
  3242. continue
  3243. fi
  3244. # The statement above tries to avoid entering an
  3245. # endless loop below, in case of cyclic links.
  3246. # We might still enter an endless loop, since a link
  3247. # loop can be closed while we follow links,
  3248. # but so what?
  3249. potlib="$potent_lib"
  3250. while test -h "$potlib" 2>/dev/null; do
  3251. potliblink=`ls -ld $potlib | ${SED} 's/.* -> //'`
  3252. case $potliblink in
  3253. [\\/]* | [A-Za-z]:[\\/]*) potlib="$potliblink";;
  3254. *) potlib=`$echo "X$potlib" | $Xsed -e 's,[^/]*$,,'`"$potliblink";;
  3255. esac
  3256. done
  3257. if eval $file_magic_cmd \"\$potlib\" 2>/dev/null \
  3258. | ${SED} 10q \
  3259. | $EGREP "$file_magic_regex" > /dev/null; then
  3260. newdeplibs="$newdeplibs $a_deplib"
  3261. a_deplib=""
  3262. break 2
  3263. fi
  3264. done
  3265. done
  3266. fi
  3267. if test -n "$a_deplib" ; then
  3268. droppeddeps=yes
  3269. $echo
  3270. $echo "*** Warning: linker path does not have real file for library $a_deplib."
  3271. $echo "*** I have the capability to make that library automatically link in when"
  3272. $echo "*** you link to this library. But I can only do this if you have a"
  3273. $echo "*** shared version of the library, which you do not appear to have"
  3274. $echo "*** because I did check the linker path looking for a file starting"
  3275. if test -z "$potlib" ; then
  3276. $echo "*** with $libname but no candidates were found. (...for file magic test)"
  3277. else
  3278. $echo "*** with $libname and none of the candidates passed a file format test"
  3279. $echo "*** using a file magic. Last file checked: $potlib"
  3280. fi
  3281. fi
  3282. else
  3283. # Add a -L argument.
  3284. newdeplibs="$newdeplibs $a_deplib"
  3285. fi
  3286. done # Gone through all deplibs.
  3287. ;;
  3288. match_pattern*)
  3289. set dummy $deplibs_check_method
  3290. match_pattern_regex=`expr "$deplibs_check_method" : "$2 \(.*\)"`
  3291. for a_deplib in $deplibs; do
  3292. name="`expr $a_deplib : '-l\(.*\)'`"
  3293. # If $name is empty we are operating on a -L argument.
  3294. if test -n "$name" && test "$name" != "0"; then
  3295. if test "X$allow_libtool_libs_with_static_runtimes" = "Xyes" ; then
  3296. case " $predeps $postdeps " in
  3297. *" $a_deplib "*)
  3298. newdeplibs="$newdeplibs $a_deplib"
  3299. a_deplib=""
  3300. ;;
  3301. esac
  3302. fi
  3303. if test -n "$a_deplib" ; then
  3304. libname=`eval \\$echo \"$libname_spec\"`
  3305. for i in $lib_search_path $sys_lib_search_path $shlib_search_path; do
  3306. potential_libs=`ls $i/$libname[.-]* 2>/dev/null`
  3307. for potent_lib in $potential_libs; do
  3308. potlib="$potent_lib" # see symlink-check above in file_magic test
  3309. if eval $echo \"$potent_lib\" 2>/dev/null \
  3310. | ${SED} 10q \
  3311. | $EGREP "$match_pattern_regex" > /dev/null; then
  3312. newdeplibs="$newdeplibs $a_deplib"
  3313. a_deplib=""
  3314. break 2
  3315. fi
  3316. done
  3317. done
  3318. fi
  3319. if test -n "$a_deplib" ; then
  3320. droppeddeps=yes
  3321. $echo
  3322. $echo "*** Warning: linker path does not have real file for library $a_deplib."
  3323. $echo "*** I have the capability to make that library automatically link in when"
  3324. $echo "*** you link to this library. But I can only do this if you have a"
  3325. $echo "*** shared version of the library, which you do not appear to have"
  3326. $echo "*** because I did check the linker path looking for a file starting"
  3327. if test -z "$potlib" ; then
  3328. $echo "*** with $libname but no candidates were found. (...for regex pattern test)"
  3329. else
  3330. $echo "*** with $libname and none of the candidates passed a file format test"
  3331. $echo "*** using a regex pattern. Last file checked: $potlib"
  3332. fi
  3333. fi
  3334. else
  3335. # Add a -L argument.
  3336. newdeplibs="$newdeplibs $a_deplib"
  3337. fi
  3338. done # Gone through all deplibs.
  3339. ;;
  3340. none | unknown | *)
  3341. newdeplibs=""
  3342. tmp_deplibs=`$echo "X $deplibs" | $Xsed -e 's/ -lc$//' \
  3343. -e 's/ -[LR][^ ]*//g'`
  3344. if test "X$allow_libtool_libs_with_static_runtimes" = "Xyes" ; then
  3345. for i in $predeps $postdeps ; do
  3346. # can't use Xsed below, because $i might contain '/'
  3347. tmp_deplibs=`$echo "X $tmp_deplibs" | ${SED} -e "1s,^X,," -e "s,$i,,"`
  3348. done
  3349. fi
  3350. if $echo "X $tmp_deplibs" | $Xsed -e 's/[ ]//g' \
  3351. | grep . >/dev/null; then
  3352. $echo
  3353. if test "X$deplibs_check_method" = "Xnone"; then
  3354. $echo "*** Warning: inter-library dependencies are not supported in this platform."
  3355. else
  3356. $echo "*** Warning: inter-library dependencies are not known to be supported."
  3357. fi
  3358. $echo "*** All declared inter-library dependencies are being dropped."
  3359. droppeddeps=yes
  3360. fi
  3361. ;;
  3362. esac
  3363. versuffix=$versuffix_save
  3364. major=$major_save
  3365. release=$release_save
  3366. libname=$libname_save
  3367. name=$name_save
  3368. case $host in
  3369. *-*-rhapsody* | *-*-darwin1.[012])
  3370. # On Rhapsody replace the C library is the System framework
  3371. newdeplibs=`$echo "X $newdeplibs" | $Xsed -e 's/ -lc / -framework System /'`
  3372. ;;
  3373. esac
  3374. if test "$droppeddeps" = yes; then
  3375. if test "$module" = yes; then
  3376. $echo
  3377. $echo "*** Warning: libtool could not satisfy all declared inter-library"
  3378. $echo "*** dependencies of module $libname. Therefore, libtool will create"
  3379. $echo "*** a static module, that should work as long as the dlopening"
  3380. $echo "*** application is linked with the -dlopen flag."
  3381. if test -z "$global_symbol_pipe"; then
  3382. $echo
  3383. $echo "*** However, this would only work if libtool was able to extract symbol"
  3384. $echo "*** lists from a program, using \`nm' or equivalent, but libtool could"
  3385. $echo "*** not find such a program. So, this module is probably useless."
  3386. $echo "*** \`nm' from GNU binutils and a full rebuild may help."
  3387. fi
  3388. if test "$build_old_libs" = no; then
  3389. oldlibs="$output_objdir/$libname.$libext"
  3390. build_libtool_libs=module
  3391. build_old_libs=yes
  3392. else
  3393. build_libtool_libs=no
  3394. fi
  3395. else
  3396. $echo "*** The inter-library dependencies that have been dropped here will be"
  3397. $echo "*** automatically added whenever a program is linked with this library"
  3398. $echo "*** or is declared to -dlopen it."
  3399. if test "$allow_undefined" = no; then
  3400. $echo
  3401. $echo "*** Since this library must not contain undefined symbols,"
  3402. $echo "*** because either the platform does not support them or"
  3403. $echo "*** it was explicitly requested with -no-undefined,"
  3404. $echo "*** libtool will only create a static version of it."
  3405. if test "$build_old_libs" = no; then
  3406. oldlibs="$output_objdir/$libname.$libext"
  3407. build_libtool_libs=module
  3408. build_old_libs=yes
  3409. else
  3410. build_libtool_libs=no
  3411. fi
  3412. fi
  3413. fi
  3414. fi
  3415. # Done checking deplibs!
  3416. deplibs=$newdeplibs
  3417. fi
  3418. # All the library-specific variables (install_libdir is set above).
  3419. library_names=
  3420. old_library=
  3421. dlname=
  3422. # Test again, we may have decided not to build it any more
  3423. if test "$build_libtool_libs" = yes; then
  3424. if test "$hardcode_into_libs" = yes; then
  3425. # Hardcode the library paths
  3426. hardcode_libdirs=
  3427. dep_rpath=
  3428. rpath="$finalize_rpath"
  3429. test "$mode" != relink && rpath="$compile_rpath$rpath"
  3430. for libdir in $rpath; do
  3431. if test -n "$hardcode_libdir_flag_spec"; then
  3432. if test -n "$hardcode_libdir_separator"; then
  3433. if test -z "$hardcode_libdirs"; then
  3434. hardcode_libdirs="$libdir"
  3435. else
  3436. # Just accumulate the unique libdirs.
  3437. case $hardcode_libdir_separator$hardcode_libdirs$hardcode_libdir_separator in
  3438. *"$hardcode_libdir_separator$libdir$hardcode_libdir_separator"*)
  3439. ;;
  3440. *)
  3441. hardcode_libdirs="$hardcode_libdirs$hardcode_libdir_separator$libdir"
  3442. ;;
  3443. esac
  3444. fi
  3445. else
  3446. eval flag=\"$hardcode_libdir_flag_spec\"
  3447. dep_rpath="$dep_rpath $flag"
  3448. fi
  3449. elif test -n "$runpath_var"; then
  3450. case "$perm_rpath " in
  3451. *" $libdir "*) ;;
  3452. *) perm_rpath="$perm_rpath $libdir" ;;
  3453. esac
  3454. fi
  3455. done
  3456. # Substitute the hardcoded libdirs into the rpath.
  3457. if test -n "$hardcode_libdir_separator" &&
  3458. test -n "$hardcode_libdirs"; then
  3459. libdir="$hardcode_libdirs"
  3460. if test -n "$hardcode_libdir_flag_spec_ld"; then
  3461. eval dep_rpath=\"$hardcode_libdir_flag_spec_ld\"
  3462. else
  3463. eval dep_rpath=\"$hardcode_libdir_flag_spec\"
  3464. fi
  3465. fi
  3466. if test -n "$runpath_var" && test -n "$perm_rpath"; then
  3467. # We should set the runpath_var.
  3468. rpath=
  3469. for dir in $perm_rpath; do
  3470. rpath="$rpath$dir:"
  3471. done
  3472. eval "$runpath_var='$rpath\$$runpath_var'; export $runpath_var"
  3473. fi
  3474. test -n "$dep_rpath" && deplibs="$dep_rpath $deplibs"
  3475. fi
  3476. shlibpath="$finalize_shlibpath"
  3477. test "$mode" != relink && shlibpath="$compile_shlibpath$shlibpath"
  3478. if test -n "$shlibpath"; then
  3479. eval "$shlibpath_var='$shlibpath\$$shlibpath_var'; export $shlibpath_var"
  3480. fi
  3481. # Get the real and link names of the library.
  3482. eval shared_ext=\"$shrext_cmds\"
  3483. eval library_names=\"$library_names_spec\"
  3484. set dummy $library_names
  3485. realname="$2"
  3486. shift; shift
  3487. if test -n "$soname_spec"; then
  3488. eval soname=\"$soname_spec\"
  3489. else
  3490. soname="$realname"
  3491. fi
  3492. if test -z "$dlname"; then
  3493. dlname=$soname
  3494. fi
  3495. lib="$output_objdir/$realname"
  3496. for link
  3497. do
  3498. linknames="$linknames $link"
  3499. done
  3500. # Use standard objects if they are pic
  3501. test -z "$pic_flag" && libobjs=`$echo "X$libobjs" | $SP2NL | $Xsed -e "$lo2o" | $NL2SP`
  3502. # Prepare the list of exported symbols
  3503. if test -z "$export_symbols"; then
  3504. if test "$always_export_symbols" = yes || test -n "$export_symbols_regex"; then
  3505. $show "generating symbol list for \`$libname.la'"
  3506. export_symbols="$output_objdir/$libname.exp"
  3507. $run $rm $export_symbols
  3508. cmds=$export_symbols_cmds
  3509. save_ifs="$IFS"; IFS='~'
  3510. for cmd in $cmds; do
  3511. IFS="$save_ifs"
  3512. eval cmd=\"$cmd\"
  3513. if len=`expr "X$cmd" : ".*"` &&
  3514. test "$len" -le "$max_cmd_len" || test "$max_cmd_len" -le -1; then
  3515. $show "$cmd"
  3516. $run eval "$cmd" || exit $?
  3517. skipped_export=false
  3518. else
  3519. # The command line is too long to execute in one step.
  3520. $show "using reloadable object file for export list..."
  3521. skipped_export=:
  3522. fi
  3523. done
  3524. IFS="$save_ifs"
  3525. if test -n "$export_symbols_regex"; then
  3526. $show "$EGREP -e \"$export_symbols_regex\" \"$export_symbols\" > \"${export_symbols}T\""
  3527. $run eval '$EGREP -e "$export_symbols_regex" "$export_symbols" > "${export_symbols}T"'
  3528. $show "$mv \"${export_symbols}T\" \"$export_symbols\""
  3529. $run eval '$mv "${export_symbols}T" "$export_symbols"'
  3530. fi
  3531. fi
  3532. fi
  3533. if test -n "$export_symbols" && test -n "$include_expsyms"; then
  3534. $run eval '$echo "X$include_expsyms" | $SP2NL >> "$export_symbols"'
  3535. fi
  3536. tmp_deplibs=
  3537. for test_deplib in $deplibs; do
  3538. case " $convenience " in
  3539. *" $test_deplib "*) ;;
  3540. *)
  3541. tmp_deplibs="$tmp_deplibs $test_deplib"
  3542. ;;
  3543. esac
  3544. done
  3545. deplibs="$tmp_deplibs"
  3546. if test -n "$convenience"; then
  3547. if test -n "$whole_archive_flag_spec"; then
  3548. save_libobjs=$libobjs
  3549. eval libobjs=\"\$libobjs $whole_archive_flag_spec\"
  3550. else
  3551. gentop="$output_objdir/${outputname}x"
  3552. generated="$generated $gentop"
  3553. func_extract_archives $gentop $convenience
  3554. libobjs="$libobjs $func_extract_archives_result"
  3555. fi
  3556. fi
  3557. if test "$thread_safe" = yes && test -n "$thread_safe_flag_spec"; then
  3558. eval flag=\"$thread_safe_flag_spec\"
  3559. linker_flags="$linker_flags $flag"
  3560. fi
  3561. # Make a backup of the uninstalled library when relinking
  3562. if test "$mode" = relink; then
  3563. $run eval '(cd $output_objdir && $rm ${realname}U && $mv $realname ${realname}U)' || exit $?
  3564. fi
  3565. # Do each of the archive commands.
  3566. if test "$module" = yes && test -n "$module_cmds" ; then
  3567. if test -n "$export_symbols" && test -n "$module_expsym_cmds"; then
  3568. eval test_cmds=\"$module_expsym_cmds\"
  3569. cmds=$module_expsym_cmds
  3570. else
  3571. eval test_cmds=\"$module_cmds\"
  3572. cmds=$module_cmds
  3573. fi
  3574. else
  3575. if test -n "$export_symbols" && test -n "$archive_expsym_cmds"; then
  3576. eval test_cmds=\"$archive_expsym_cmds\"
  3577. cmds=$archive_expsym_cmds
  3578. else
  3579. eval test_cmds=\"$archive_cmds\"
  3580. cmds=$archive_cmds
  3581. fi
  3582. fi
  3583. if test "X$skipped_export" != "X:" && len=`expr "X$test_cmds" : ".*"` &&
  3584. test "$len" -le "$max_cmd_len" || test "$max_cmd_len" -le -1; then
  3585. :
  3586. else
  3587. # The command line is too long to link in one step, link piecewise.
  3588. $echo "creating reloadable object files..."
  3589. # Save the value of $output and $libobjs because we want to
  3590. # use them later. If we have whole_archive_flag_spec, we
  3591. # want to use save_libobjs as it was before
  3592. # whole_archive_flag_spec was expanded, because we can't
  3593. # assume the linker understands whole_archive_flag_spec.
  3594. # This may have to be revisited, in case too many
  3595. # convenience libraries get linked in and end up exceeding
  3596. # the spec.
  3597. if test -z "$convenience" || test -z "$whole_archive_flag_spec"; then
  3598. save_libobjs=$libobjs
  3599. fi
  3600. save_output=$output
  3601. output_la=`$echo "X$output" | $Xsed -e "$basename"`
  3602. # Clear the reloadable object creation command queue and
  3603. # initialize k to one.
  3604. test_cmds=
  3605. concat_cmds=
  3606. objlist=
  3607. delfiles=
  3608. last_robj=
  3609. k=1
  3610. output=$output_objdir/$output_la-${k}.$objext
  3611. # Loop over the list of objects to be linked.
  3612. for obj in $save_libobjs
  3613. do
  3614. eval test_cmds=\"$reload_cmds $objlist $last_robj\"
  3615. if test "X$objlist" = X ||
  3616. { len=`expr "X$test_cmds" : ".*"` &&
  3617. test "$len" -le "$max_cmd_len"; }; then
  3618. objlist="$objlist $obj"
  3619. else
  3620. # The command $test_cmds is almost too long, add a
  3621. # command to the queue.
  3622. if test "$k" -eq 1 ; then
  3623. # The first file doesn't have a previous command to add.
  3624. eval concat_cmds=\"$reload_cmds $objlist $last_robj\"
  3625. else
  3626. # All subsequent reloadable object files will link in
  3627. # the last one created.
  3628. eval concat_cmds=\"\$concat_cmds~$reload_cmds $objlist $last_robj\"
  3629. fi
  3630. last_robj=$output_objdir/$output_la-${k}.$objext
  3631. k=`expr $k + 1`
  3632. output=$output_objdir/$output_la-${k}.$objext
  3633. objlist=$obj
  3634. len=1
  3635. fi
  3636. done
  3637. # Handle the remaining objects by creating one last
  3638. # reloadable object file. All subsequent reloadable object
  3639. # files will link in the last one created.
  3640. test -z "$concat_cmds" || concat_cmds=$concat_cmds~
  3641. eval concat_cmds=\"\${concat_cmds}$reload_cmds $objlist $last_robj\"
  3642. if ${skipped_export-false}; then
  3643. $show "generating symbol list for \`$libname.la'"
  3644. export_symbols="$output_objdir/$libname.exp"
  3645. $run $rm $export_symbols
  3646. libobjs=$output
  3647. # Append the command to create the export file.
  3648. eval concat_cmds=\"\$concat_cmds~$export_symbols_cmds\"
  3649. fi
  3650. # Set up a command to remove the reloadable object files
  3651. # after they are used.
  3652. i=0
  3653. while test "$i" -lt "$k"
  3654. do
  3655. i=`expr $i + 1`
  3656. delfiles="$delfiles $output_objdir/$output_la-${i}.$objext"
  3657. done
  3658. $echo "creating a temporary reloadable object file: $output"
  3659. # Loop through the commands generated above and execute them.
  3660. save_ifs="$IFS"; IFS='~'
  3661. for cmd in $concat_cmds; do
  3662. IFS="$save_ifs"
  3663. $show "$cmd"
  3664. $run eval "$cmd" || exit $?
  3665. done
  3666. IFS="$save_ifs"
  3667. libobjs=$output
  3668. # Restore the value of output.
  3669. output=$save_output
  3670. if test -n "$convenience" && test -n "$whole_archive_flag_spec"; then
  3671. eval libobjs=\"\$libobjs $whole_archive_flag_spec\"
  3672. fi
  3673. # Expand the library linking commands again to reset the
  3674. # value of $libobjs for piecewise linking.
  3675. # Do each of the archive commands.
  3676. if test "$module" = yes && test -n "$module_cmds" ; then
  3677. if test -n "$export_symbols" && test -n "$module_expsym_cmds"; then
  3678. cmds=$module_expsym_cmds
  3679. else
  3680. cmds=$module_cmds
  3681. fi
  3682. else
  3683. if test -n "$export_symbols" && test -n "$archive_expsym_cmds"; then
  3684. cmds=$archive_expsym_cmds
  3685. else
  3686. cmds=$archive_cmds
  3687. fi
  3688. fi
  3689. # Append the command to remove the reloadable object files
  3690. # to the just-reset $cmds.
  3691. eval cmds=\"\$cmds~\$rm $delfiles\"
  3692. fi
  3693. save_ifs="$IFS"; IFS='~'
  3694. for cmd in $cmds; do
  3695. IFS="$save_ifs"
  3696. eval cmd=\"$cmd\"
  3697. $show "$cmd"
  3698. $run eval "$cmd" || exit $?
  3699. done
  3700. IFS="$save_ifs"
  3701. # Restore the uninstalled library and exit
  3702. if test "$mode" = relink; then
  3703. $run eval '(cd $output_objdir && $rm ${realname}T && $mv $realname ${realname}T && $mv "$realname"U $realname)' || exit $?
  3704. exit $EXIT_SUCCESS
  3705. fi
  3706. # Create links to the real library.
  3707. for linkname in $linknames; do
  3708. if test "$realname" != "$linkname"; then
  3709. $show "(cd $output_objdir && $rm $linkname && $LN_S $realname $linkname)"
  3710. $run eval '(cd $output_objdir && $rm $linkname && $LN_S $realname $linkname)' || exit $?
  3711. fi
  3712. done
  3713. # If -module or -export-dynamic was specified, set the dlname.
  3714. if test "$module" = yes || test "$export_dynamic" = yes; then
  3715. # On all known operating systems, these are identical.
  3716. dlname="$soname"
  3717. fi
  3718. fi
  3719. ;;
  3720. obj)
  3721. if test -n "$deplibs"; then
  3722. $echo "$modename: warning: \`-l' and \`-L' are ignored for objects" 1>&2
  3723. fi
  3724. if test -n "$dlfiles$dlprefiles" || test "$dlself" != no; then
  3725. $echo "$modename: warning: \`-dlopen' is ignored for objects" 1>&2
  3726. fi
  3727. if test -n "$rpath"; then
  3728. $echo "$modename: warning: \`-rpath' is ignored for objects" 1>&2
  3729. fi
  3730. if test -n "$xrpath"; then
  3731. $echo "$modename: warning: \`-R' is ignored for objects" 1>&2
  3732. fi
  3733. if test -n "$vinfo"; then
  3734. $echo "$modename: warning: \`-version-info' is ignored for objects" 1>&2
  3735. fi
  3736. if test -n "$release"; then
  3737. $echo "$modename: warning: \`-release' is ignored for objects" 1>&2
  3738. fi
  3739. case $output in
  3740. *.lo)
  3741. if test -n "$objs$old_deplibs"; then
  3742. $echo "$modename: cannot build library object \`$output' from non-libtool objects" 1>&2
  3743. exit $EXIT_FAILURE
  3744. fi
  3745. libobj="$output"
  3746. obj=`$echo "X$output" | $Xsed -e "$lo2o"`
  3747. ;;
  3748. *)
  3749. libobj=
  3750. obj="$output"
  3751. ;;
  3752. esac
  3753. # Delete the old objects.
  3754. $run $rm $obj $libobj
  3755. # Objects from convenience libraries. This assumes
  3756. # single-version convenience libraries. Whenever we create
  3757. # different ones for PIC/non-PIC, this we'll have to duplicate
  3758. # the extraction.
  3759. reload_conv_objs=
  3760. gentop=
  3761. # reload_cmds runs $LD directly, so let us get rid of
  3762. # -Wl from whole_archive_flag_spec
  3763. wl=
  3764. if test -n "$convenience"; then
  3765. if test -n "$whole_archive_flag_spec"; then
  3766. eval reload_conv_objs=\"\$reload_objs $whole_archive_flag_spec\"
  3767. else
  3768. gentop="$output_objdir/${obj}x"
  3769. generated="$generated $gentop"
  3770. func_extract_archives $gentop $convenience
  3771. reload_conv_objs="$reload_objs $func_extract_archives_result"
  3772. fi
  3773. fi
  3774. # Create the old-style object.
  3775. reload_objs="$objs$old_deplibs "`$echo "X$libobjs" | $SP2NL | $Xsed -e '/\.'${libext}$'/d' -e '/\.lib$/d' -e "$lo2o" | $NL2SP`" $reload_conv_objs" ### testsuite: skip nested quoting test
  3776. output="$obj"
  3777. cmds=$reload_cmds
  3778. save_ifs="$IFS"; IFS='~'
  3779. for cmd in $cmds; do
  3780. IFS="$save_ifs"
  3781. eval cmd=\"$cmd\"
  3782. $show "$cmd"
  3783. $run eval "$cmd" || exit $?
  3784. done
  3785. IFS="$save_ifs"
  3786. # Exit if we aren't doing a library object file.
  3787. if test -z "$libobj"; then
  3788. if test -n "$gentop"; then
  3789. $show "${rm}r $gentop"
  3790. $run ${rm}r $gentop
  3791. fi
  3792. exit $EXIT_SUCCESS
  3793. fi
  3794. if test "$build_libtool_libs" != yes; then
  3795. if test -n "$gentop"; then
  3796. $show "${rm}r $gentop"
  3797. $run ${rm}r $gentop
  3798. fi
  3799. # Create an invalid libtool object if no PIC, so that we don't
  3800. # accidentally link it into a program.
  3801. # $show "echo timestamp > $libobj"
  3802. # $run eval "echo timestamp > $libobj" || exit $?
  3803. exit $EXIT_SUCCESS
  3804. fi
  3805. if test -n "$pic_flag" || test "$pic_mode" != default; then
  3806. # Only do commands if we really have different PIC objects.
  3807. reload_objs="$libobjs $reload_conv_objs"
  3808. output="$libobj"
  3809. cmds=$reload_cmds
  3810. save_ifs="$IFS"; IFS='~'
  3811. for cmd in $cmds; do
  3812. IFS="$save_ifs"
  3813. eval cmd=\"$cmd\"
  3814. $show "$cmd"
  3815. $run eval "$cmd" || exit $?
  3816. done
  3817. IFS="$save_ifs"
  3818. fi
  3819. if test -n "$gentop"; then
  3820. $show "${rm}r $gentop"
  3821. $run ${rm}r $gentop
  3822. fi
  3823. exit $EXIT_SUCCESS
  3824. ;;
  3825. prog)
  3826. case $host in
  3827. *cygwin*) output=`$echo $output | ${SED} -e 's,.exe$,,;s,$,.exe,'` ;;
  3828. esac
  3829. if test -n "$vinfo"; then
  3830. $echo "$modename: warning: \`-version-info' is ignored for programs" 1>&2
  3831. fi
  3832. if test -n "$release"; then
  3833. $echo "$modename: warning: \`-release' is ignored for programs" 1>&2
  3834. fi
  3835. if test "$preload" = yes; then
  3836. if test "$dlopen_support" = unknown && test "$dlopen_self" = unknown &&
  3837. test "$dlopen_self_static" = unknown; then
  3838. $echo "$modename: warning: \`AC_LIBTOOL_DLOPEN' not used. Assuming no dlopen support."
  3839. fi
  3840. fi
  3841. case $host in
  3842. *-*-rhapsody* | *-*-darwin1.[012])
  3843. # On Rhapsody replace the C library is the System framework
  3844. compile_deplibs=`$echo "X $compile_deplibs" | $Xsed -e 's/ -lc / -framework System /'`
  3845. finalize_deplibs=`$echo "X $finalize_deplibs" | $Xsed -e 's/ -lc / -framework System /'`
  3846. ;;
  3847. esac
  3848. case $host in
  3849. *darwin*)
  3850. # Don't allow lazy linking, it breaks C++ global constructors
  3851. if test "$tagname" = CXX ; then
  3852. compile_command="$compile_command ${wl}-bind_at_load"
  3853. finalize_command="$finalize_command ${wl}-bind_at_load"
  3854. fi
  3855. ;;
  3856. esac
  3857. compile_command="$compile_command $compile_deplibs"
  3858. finalize_command="$finalize_command $finalize_deplibs"
  3859. if test -n "$rpath$xrpath"; then
  3860. # If the user specified any rpath flags, then add them.
  3861. for libdir in $rpath $xrpath; do
  3862. # This is the magic to use -rpath.
  3863. case "$finalize_rpath " in
  3864. *" $libdir "*) ;;
  3865. *) finalize_rpath="$finalize_rpath $libdir" ;;
  3866. esac
  3867. done
  3868. fi
  3869. # Now hardcode the library paths
  3870. rpath=
  3871. hardcode_libdirs=
  3872. for libdir in $compile_rpath $finalize_rpath; do
  3873. if test -n "$hardcode_libdir_flag_spec"; then
  3874. if test -n "$hardcode_libdir_separator"; then
  3875. if test -z "$hardcode_libdirs"; then
  3876. hardcode_libdirs="$libdir"
  3877. else
  3878. # Just accumulate the unique libdirs.
  3879. case $hardcode_libdir_separator$hardcode_libdirs$hardcode_libdir_separator in
  3880. *"$hardcode_libdir_separator$libdir$hardcode_libdir_separator"*)
  3881. ;;
  3882. *)
  3883. hardcode_libdirs="$hardcode_libdirs$hardcode_libdir_separator$libdir"
  3884. ;;
  3885. esac
  3886. fi
  3887. else
  3888. eval flag=\"$hardcode_libdir_flag_spec\"
  3889. rpath="$rpath $flag"
  3890. fi
  3891. elif test -n "$runpath_var"; then
  3892. case "$perm_rpath " in
  3893. *" $libdir "*) ;;
  3894. *) perm_rpath="$perm_rpath $libdir" ;;
  3895. esac
  3896. fi
  3897. case $host in
  3898. *-*-cygwin* | *-*-mingw* | *-*-pw32* | *-*-os2*)
  3899. case :$dllsearchpath: in
  3900. *":$libdir:"*) ;;
  3901. *) dllsearchpath="$dllsearchpath:$libdir";;
  3902. esac
  3903. ;;
  3904. esac
  3905. done
  3906. # Substitute the hardcoded libdirs into the rpath.
  3907. if test -n "$hardcode_libdir_separator" &&
  3908. test -n "$hardcode_libdirs"; then
  3909. libdir="$hardcode_libdirs"
  3910. eval rpath=\" $hardcode_libdir_flag_spec\"
  3911. fi
  3912. compile_rpath="$rpath"
  3913. rpath=
  3914. hardcode_libdirs=
  3915. for libdir in $finalize_rpath; do
  3916. if test -n "$hardcode_libdir_flag_spec"; then
  3917. if test -n "$hardcode_libdir_separator"; then
  3918. if test -z "$hardcode_libdirs"; then
  3919. hardcode_libdirs="$libdir"
  3920. else
  3921. # Just accumulate the unique libdirs.
  3922. case $hardcode_libdir_separator$hardcode_libdirs$hardcode_libdir_separator in
  3923. *"$hardcode_libdir_separator$libdir$hardcode_libdir_separator"*)
  3924. ;;
  3925. *)
  3926. hardcode_libdirs="$hardcode_libdirs$hardcode_libdir_separator$libdir"
  3927. ;;
  3928. esac
  3929. fi
  3930. else
  3931. eval flag=\"$hardcode_libdir_flag_spec\"
  3932. rpath="$rpath $flag"
  3933. fi
  3934. elif test -n "$runpath_var"; then
  3935. case "$finalize_perm_rpath " in
  3936. *" $libdir "*) ;;
  3937. *) finalize_perm_rpath="$finalize_perm_rpath $libdir" ;;
  3938. esac
  3939. fi
  3940. done
  3941. # Substitute the hardcoded libdirs into the rpath.
  3942. if test -n "$hardcode_libdir_separator" &&
  3943. test -n "$hardcode_libdirs"; then
  3944. libdir="$hardcode_libdirs"
  3945. eval rpath=\" $hardcode_libdir_flag_spec\"
  3946. fi
  3947. finalize_rpath="$rpath"
  3948. if test -n "$libobjs" && test "$build_old_libs" = yes; then
  3949. # Transform all the library objects into standard objects.
  3950. compile_command=`$echo "X$compile_command" | $SP2NL | $Xsed -e "$lo2o" | $NL2SP`
  3951. finalize_command=`$echo "X$finalize_command" | $SP2NL | $Xsed -e "$lo2o" | $NL2SP`
  3952. fi
  3953. dlsyms=
  3954. if test -n "$dlfiles$dlprefiles" || test "$dlself" != no; then
  3955. if test -n "$NM" && test -n "$global_symbol_pipe"; then
  3956. dlsyms="${outputname}S.c"
  3957. else
  3958. $echo "$modename: not configured to extract global symbols from dlpreopened files" 1>&2
  3959. fi
  3960. fi
  3961. if test -n "$dlsyms"; then
  3962. case $dlsyms in
  3963. "") ;;
  3964. *.c)
  3965. # Discover the nlist of each of the dlfiles.
  3966. nlist="$output_objdir/${outputname}.nm"
  3967. $show "$rm $nlist ${nlist}S ${nlist}T"
  3968. $run $rm "$nlist" "${nlist}S" "${nlist}T"
  3969. # Parse the name list into a source file.
  3970. $show "creating $output_objdir/$dlsyms"
  3971. test -z "$run" && $echo > "$output_objdir/$dlsyms" "\
  3972. /* $dlsyms - symbol resolution table for \`$outputname' dlsym emulation. */
  3973. /* Generated by $PROGRAM - GNU $PACKAGE $VERSION$TIMESTAMP */
  3974. #ifdef __cplusplus
  3975. extern \"C\" {
  3976. #endif
  3977. /* Prevent the only kind of declaration conflicts we can make. */
  3978. #define lt_preloaded_symbols some_other_symbol
  3979. /* External symbol declarations for the compiler. */\
  3980. "
  3981. if test "$dlself" = yes; then
  3982. $show "generating symbol list for \`$output'"
  3983. test -z "$run" && $echo ': @PROGRAM@ ' > "$nlist"
  3984. # Add our own program objects to the symbol list.
  3985. progfiles=`$echo "X$objs$old_deplibs" | $SP2NL | $Xsed -e "$lo2o" | $NL2SP`
  3986. for arg in $progfiles; do
  3987. $show "extracting global C symbols from \`$arg'"
  3988. $run eval "$NM $arg | $global_symbol_pipe >> '$nlist'"
  3989. done
  3990. if test -n "$exclude_expsyms"; then
  3991. $run eval '$EGREP -v " ($exclude_expsyms)$" "$nlist" > "$nlist"T'
  3992. $run eval '$mv "$nlist"T "$nlist"'
  3993. fi
  3994. if test -n "$export_symbols_regex"; then
  3995. $run eval '$EGREP -e "$export_symbols_regex" "$nlist" > "$nlist"T'
  3996. $run eval '$mv "$nlist"T "$nlist"'
  3997. fi
  3998. # Prepare the list of exported symbols
  3999. if test -z "$export_symbols"; then
  4000. export_symbols="$output_objdir/$outputname.exp"
  4001. $run $rm $export_symbols
  4002. $run eval "${SED} -n -e '/^: @PROGRAM@$/d' -e 's/^.* \(.*\)$/\1/p' "'< "$nlist" > "$export_symbols"'
  4003. else
  4004. $run eval "${SED} -e 's/\([ ][.*^$]\)/\\\1/g' -e 's/^/ /' -e 's/$/$/'"' < "$export_symbols" > "$output_objdir/$outputname.exp"'
  4005. $run eval 'grep -f "$output_objdir/$outputname.exp" < "$nlist" > "$nlist"T'
  4006. $run eval 'mv "$nlist"T "$nlist"'
  4007. fi
  4008. fi
  4009. for arg in $dlprefiles; do
  4010. $show "extracting global C symbols from \`$arg'"
  4011. name=`$echo "$arg" | ${SED} -e 's%^.*/%%'`
  4012. $run eval '$echo ": $name " >> "$nlist"'
  4013. $run eval "$NM $arg | $global_symbol_pipe >> '$nlist'"
  4014. done
  4015. if test -z "$run"; then
  4016. # Make sure we have at least an empty file.
  4017. test -f "$nlist" || : > "$nlist"
  4018. if test -n "$exclude_expsyms"; then
  4019. $EGREP -v " ($exclude_expsyms)$" "$nlist" > "$nlist"T
  4020. $mv "$nlist"T "$nlist"
  4021. fi
  4022. # Try sorting and uniquifying the output.
  4023. if grep -v "^: " < "$nlist" |
  4024. if sort -k 3 </dev/null >/dev/null 2>&1; then
  4025. sort -k 3
  4026. else
  4027. sort +2
  4028. fi |
  4029. uniq > "$nlist"S; then
  4030. :
  4031. else
  4032. grep -v "^: " < "$nlist" > "$nlist"S
  4033. fi
  4034. if test -f "$nlist"S; then
  4035. eval "$global_symbol_to_cdecl"' < "$nlist"S >> "$output_objdir/$dlsyms"'
  4036. else
  4037. $echo '/* NONE */' >> "$output_objdir/$dlsyms"
  4038. fi
  4039. $echo >> "$output_objdir/$dlsyms" "\
  4040. #undef lt_preloaded_symbols
  4041. #if defined (__STDC__) && __STDC__
  4042. # define lt_ptr void *
  4043. #else
  4044. # define lt_ptr char *
  4045. # define const
  4046. #endif
  4047. /* The mapping between symbol names and symbols. */
  4048. "
  4049. case $host in
  4050. *cygwin* | *mingw* )
  4051. $echo >> "$output_objdir/$dlsyms" "\
  4052. /* DATA imports from DLLs on WIN32 can't be const, because
  4053. runtime relocations are performed -- see ld's documentation
  4054. on pseudo-relocs */
  4055. struct {
  4056. "
  4057. ;;
  4058. * )
  4059. $echo >> "$output_objdir/$dlsyms" "\
  4060. const struct {
  4061. "
  4062. ;;
  4063. esac
  4064. $echo >> "$output_objdir/$dlsyms" "\
  4065. const char *name;
  4066. lt_ptr address;
  4067. }
  4068. lt_preloaded_symbols[] =
  4069. {\
  4070. "
  4071. eval "$global_symbol_to_c_name_address" < "$nlist" >> "$output_objdir/$dlsyms"
  4072. $echo >> "$output_objdir/$dlsyms" "\
  4073. {0, (lt_ptr) 0}
  4074. };
  4075. /* This works around a problem in FreeBSD linker */
  4076. #ifdef FREEBSD_WORKAROUND
  4077. static const void *lt_preloaded_setup() {
  4078. return lt_preloaded_symbols;
  4079. }
  4080. #endif
  4081. #ifdef __cplusplus
  4082. }
  4083. #endif\
  4084. "
  4085. fi
  4086. pic_flag_for_symtable=
  4087. case $host in
  4088. # compiling the symbol table file with pic_flag works around
  4089. # a FreeBSD bug that causes programs to crash when -lm is
  4090. # linked before any other PIC object. But we must not use
  4091. # pic_flag when linking with -static. The problem exists in
  4092. # FreeBSD 2.2.6 and is fixed in FreeBSD 3.1.
  4093. *-*-freebsd2*|*-*-freebsd3.0*|*-*-freebsdelf3.0*)
  4094. case "$compile_command " in
  4095. *" -static "*) ;;
  4096. *) pic_flag_for_symtable=" $pic_flag -DFREEBSD_WORKAROUND";;
  4097. esac;;
  4098. *-*-hpux*)
  4099. case "$compile_command " in
  4100. *" -static "*) ;;
  4101. *) pic_flag_for_symtable=" $pic_flag";;
  4102. esac
  4103. esac
  4104. # Now compile the dynamic symbol file.
  4105. $show "(cd $output_objdir && $LTCC -c$no_builtin_flag$pic_flag_for_symtable \"$dlsyms\")"
  4106. $run eval '(cd $output_objdir && $LTCC -c$no_builtin_flag$pic_flag_for_symtable "$dlsyms")' || exit $?
  4107. # Clean up the generated files.
  4108. $show "$rm $output_objdir/$dlsyms $nlist ${nlist}S ${nlist}T"
  4109. $run $rm "$output_objdir/$dlsyms" "$nlist" "${nlist}S" "${nlist}T"
  4110. # Transform the symbol file into the correct name.
  4111. compile_command=`$echo "X$compile_command" | $Xsed -e "s%@SYMFILE@%$output_objdir/${outputname}S.${objext}%"`
  4112. finalize_command=`$echo "X$finalize_command" | $Xsed -e "s%@SYMFILE@%$output_objdir/${outputname}S.${objext}%"`
  4113. ;;
  4114. *)
  4115. $echo "$modename: unknown suffix for \`$dlsyms'" 1>&2
  4116. exit $EXIT_FAILURE
  4117. ;;
  4118. esac
  4119. else
  4120. # We keep going just in case the user didn't refer to
  4121. # lt_preloaded_symbols. The linker will fail if global_symbol_pipe
  4122. # really was required.
  4123. # Nullify the symbol file.
  4124. compile_command=`$echo "X$compile_command" | $Xsed -e "s% @SYMFILE@%%"`
  4125. finalize_command=`$echo "X$finalize_command" | $Xsed -e "s% @SYMFILE@%%"`
  4126. fi
  4127. if test "$need_relink" = no || test "$build_libtool_libs" != yes; then
  4128. # Replace the output file specification.
  4129. compile_command=`$echo "X$compile_command" | $Xsed -e 's%@OUTPUT@%'"$output"'%g'`
  4130. link_command="$compile_command$compile_rpath"
  4131. # We have no uninstalled library dependencies, so finalize right now.
  4132. $show "$link_command"
  4133. $run eval "$link_command"
  4134. status=$?
  4135. # Delete the generated files.
  4136. if test -n "$dlsyms"; then
  4137. $show "$rm $output_objdir/${outputname}S.${objext}"
  4138. $run $rm "$output_objdir/${outputname}S.${objext}"
  4139. fi
  4140. exit $status
  4141. fi
  4142. if test -n "$shlibpath_var"; then
  4143. # We should set the shlibpath_var
  4144. rpath=
  4145. for dir in $temp_rpath; do
  4146. case $dir in
  4147. [\\/]* | [A-Za-z]:[\\/]*)
  4148. # Absolute path.
  4149. rpath="$rpath$dir:"
  4150. ;;
  4151. *)
  4152. # Relative path: add a thisdir entry.
  4153. rpath="$rpath\$thisdir/$dir:"
  4154. ;;
  4155. esac
  4156. done
  4157. temp_rpath="$rpath"
  4158. fi
  4159. if test -n "$compile_shlibpath$finalize_shlibpath"; then
  4160. compile_command="$shlibpath_var=\"$compile_shlibpath$finalize_shlibpath\$$shlibpath_var\" $compile_command"
  4161. fi
  4162. if test -n "$finalize_shlibpath"; then
  4163. finalize_command="$shlibpath_var=\"$finalize_shlibpath\$$shlibpath_var\" $finalize_command"
  4164. fi
  4165. compile_var=
  4166. finalize_var=
  4167. if test -n "$runpath_var"; then
  4168. if test -n "$perm_rpath"; then
  4169. # We should set the runpath_var.
  4170. rpath=
  4171. for dir in $perm_rpath; do
  4172. rpath="$rpath$dir:"
  4173. done
  4174. compile_var="$runpath_var=\"$rpath\$$runpath_var\" "
  4175. fi
  4176. if test -n "$finalize_perm_rpath"; then
  4177. # We should set the runpath_var.
  4178. rpath=
  4179. for dir in $finalize_perm_rpath; do
  4180. rpath="$rpath$dir:"
  4181. done
  4182. finalize_var="$runpath_var=\"$rpath\$$runpath_var\" "
  4183. fi
  4184. fi
  4185. if test "$no_install" = yes; then
  4186. # We don't need to create a wrapper script.
  4187. link_command="$compile_var$compile_command$compile_rpath"
  4188. # Replace the output file specification.
  4189. link_command=`$echo "X$link_command" | $Xsed -e 's%@OUTPUT@%'"$output"'%g'`
  4190. # Delete the old output file.
  4191. $run $rm $output
  4192. # Link the executable and exit
  4193. $show "$link_command"
  4194. $run eval "$link_command" || exit $?
  4195. exit $EXIT_SUCCESS
  4196. fi
  4197. if test "$hardcode_action" = relink; then
  4198. # Fast installation is not supported
  4199. link_command="$compile_var$compile_command$compile_rpath"
  4200. relink_command="$finalize_var$finalize_command$finalize_rpath"
  4201. $echo "$modename: warning: this platform does not like uninstalled shared libraries" 1>&2
  4202. $echo "$modename: \`$output' will be relinked during installation" 1>&2
  4203. else
  4204. if test "$fast_install" != no; then
  4205. link_command="$finalize_var$compile_command$finalize_rpath"
  4206. if test "$fast_install" = yes; then
  4207. relink_command=`$echo "X$compile_var$compile_command$compile_rpath" | $Xsed -e 's%@OUTPUT@%\$progdir/\$file%g'`
  4208. else
  4209. # fast_install is set to needless
  4210. relink_command=
  4211. fi
  4212. else
  4213. link_command="$compile_var$compile_command$compile_rpath"
  4214. relink_command="$finalize_var$finalize_command$finalize_rpath"
  4215. fi
  4216. fi
  4217. # Replace the output file specification.
  4218. link_command=`$echo "X$link_command" | $Xsed -e 's%@OUTPUT@%'"$output_objdir/$outputname"'%g'`
  4219. # Delete the old output files.
  4220. $run $rm $output $output_objdir/$outputname $output_objdir/lt-$outputname
  4221. $show "$link_command"
  4222. $run eval "$link_command" || exit $?
  4223. # Now create the wrapper script.
  4224. $show "creating $output"
  4225. # Quote the relink command for shipping.
  4226. if test -n "$relink_command"; then
  4227. # Preserve any variables that may affect compiler behavior
  4228. for var in $variables_saved_for_relink; do
  4229. if eval test -z \"\${$var+set}\"; then
  4230. relink_command="{ test -z \"\${$var+set}\" || unset $var || { $var=; export $var; }; }; $relink_command"
  4231. elif eval var_value=\$$var; test -z "$var_value"; then
  4232. relink_command="$var=; export $var; $relink_command"
  4233. else
  4234. var_value=`$echo "X$var_value" | $Xsed -e "$sed_quote_subst"`
  4235. relink_command="$var=\"$var_value\"; export $var; $relink_command"
  4236. fi
  4237. done
  4238. relink_command="(cd `pwd`; $relink_command)"
  4239. relink_command=`$echo "X$relink_command" | $Xsed -e "$sed_quote_subst"`
  4240. fi
  4241. # Quote $echo for shipping.
  4242. if test "X$echo" = "X$SHELL $progpath --fallback-echo"; then
  4243. case $progpath in
  4244. [\\/]* | [A-Za-z]:[\\/]*) qecho="$SHELL $progpath --fallback-echo";;
  4245. *) qecho="$SHELL `pwd`/$progpath --fallback-echo";;
  4246. esac
  4247. qecho=`$echo "X$qecho" | $Xsed -e "$sed_quote_subst"`
  4248. else
  4249. qecho=`$echo "X$echo" | $Xsed -e "$sed_quote_subst"`
  4250. fi
  4251. # Only actually do things if our run command is non-null.
  4252. if test -z "$run"; then
  4253. # win32 will think the script is a binary if it has
  4254. # a .exe suffix, so we strip it off here.
  4255. case $output in
  4256. *.exe) output=`$echo $output|${SED} 's,.exe$,,'` ;;
  4257. esac
  4258. # test for cygwin because mv fails w/o .exe extensions
  4259. case $host in
  4260. *cygwin*)
  4261. exeext=.exe
  4262. outputname=`$echo $outputname|${SED} 's,.exe$,,'` ;;
  4263. *) exeext= ;;
  4264. esac
  4265. case $host in
  4266. *cygwin* | *mingw* )
  4267. cwrappersource=`$echo ${objdir}/lt-${outputname}.c`
  4268. cwrapper=`$echo ${output}.exe`
  4269. $rm $cwrappersource $cwrapper
  4270. trap "$rm $cwrappersource $cwrapper; exit $EXIT_FAILURE" 1 2 15
  4271. cat > $cwrappersource <<EOF
  4272. /* $cwrappersource - temporary wrapper executable for $objdir/$outputname
  4273. Generated by $PROGRAM - GNU $PACKAGE $VERSION$TIMESTAMP
  4274. The $output program cannot be directly executed until all the libtool
  4275. libraries that it depends on are installed.
  4276. This wrapper executable should never be moved out of the build directory.
  4277. If it is, it will not operate correctly.
  4278. Currently, it simply execs the wrapper *script* "/bin/sh $output",
  4279. but could eventually absorb all of the scripts functionality and
  4280. exec $objdir/$outputname directly.
  4281. */
  4282. EOF
  4283. cat >> $cwrappersource<<"EOF"
  4284. #include <stdio.h>
  4285. #include <stdlib.h>
  4286. #include <unistd.h>
  4287. #include <malloc.h>
  4288. #include <stdarg.h>
  4289. #include <assert.h>
  4290. #if defined(PATH_MAX)
  4291. # define LT_PATHMAX PATH_MAX
  4292. #elif defined(MAXPATHLEN)
  4293. # define LT_PATHMAX MAXPATHLEN
  4294. #else
  4295. # define LT_PATHMAX 1024
  4296. #endif
  4297. #ifndef DIR_SEPARATOR
  4298. #define DIR_SEPARATOR '/'
  4299. #endif
  4300. #if defined (_WIN32) || defined (__MSDOS__) || defined (__DJGPP__) || \
  4301. defined (__OS2__)
  4302. #define HAVE_DOS_BASED_FILE_SYSTEM
  4303. #ifndef DIR_SEPARATOR_2
  4304. #define DIR_SEPARATOR_2 '\\'
  4305. #endif
  4306. #endif
  4307. #ifndef DIR_SEPARATOR_2
  4308. # define IS_DIR_SEPARATOR(ch) ((ch) == DIR_SEPARATOR)
  4309. #else /* DIR_SEPARATOR_2 */
  4310. # define IS_DIR_SEPARATOR(ch) \
  4311. (((ch) == DIR_SEPARATOR) || ((ch) == DIR_SEPARATOR_2))
  4312. #endif /* DIR_SEPARATOR_2 */
  4313. #define XMALLOC(type, num) ((type *) xmalloc ((num) * sizeof(type)))
  4314. #define XFREE(stale) do { \
  4315. if (stale) { free ((void *) stale); stale = 0; } \
  4316. } while (0)
  4317. const char *program_name = NULL;
  4318. void * xmalloc (size_t num);
  4319. char * xstrdup (const char *string);
  4320. char * basename (const char *name);
  4321. char * fnqualify(const char *path);
  4322. char * strendzap(char *str, const char *pat);
  4323. void lt_fatal (const char *message, ...);
  4324. int
  4325. main (int argc, char *argv[])
  4326. {
  4327. char **newargz;
  4328. int i;
  4329. program_name = (char *) xstrdup ((char *) basename (argv[0]));
  4330. newargz = XMALLOC(char *, argc+2);
  4331. EOF
  4332. cat >> $cwrappersource <<EOF
  4333. newargz[0] = "$SHELL";
  4334. EOF
  4335. cat >> $cwrappersource <<"EOF"
  4336. newargz[1] = fnqualify(argv[0]);
  4337. /* we know the script has the same name, without the .exe */
  4338. /* so make sure newargz[1] doesn't end in .exe */
  4339. strendzap(newargz[1],".exe");
  4340. for (i = 1; i < argc; i++)
  4341. newargz[i+1] = xstrdup(argv[i]);
  4342. newargz[argc+1] = NULL;
  4343. EOF
  4344. cat >> $cwrappersource <<EOF
  4345. execv("$SHELL",newargz);
  4346. EOF
  4347. cat >> $cwrappersource <<"EOF"
  4348. }
  4349. void *
  4350. xmalloc (size_t num)
  4351. {
  4352. void * p = (void *) malloc (num);
  4353. if (!p)
  4354. lt_fatal ("Memory exhausted");
  4355. return p;
  4356. }
  4357. char *
  4358. xstrdup (const char *string)
  4359. {
  4360. return string ? strcpy ((char *) xmalloc (strlen (string) + 1), string) : NULL
  4361. ;
  4362. }
  4363. char *
  4364. basename (const char *name)
  4365. {
  4366. const char *base;
  4367. #if defined (HAVE_DOS_BASED_FILE_SYSTEM)
  4368. /* Skip over the disk name in MSDOS pathnames. */
  4369. if (isalpha (name[0]) && name[1] == ':')
  4370. name += 2;
  4371. #endif
  4372. for (base = name; *name; name++)
  4373. if (IS_DIR_SEPARATOR (*name))
  4374. base = name + 1;
  4375. return (char *) base;
  4376. }
  4377. char *
  4378. fnqualify(const char *path)
  4379. {
  4380. size_t size;
  4381. char *p;
  4382. char tmp[LT_PATHMAX + 1];
  4383. assert(path != NULL);
  4384. /* Is it qualified already? */
  4385. #if defined (HAVE_DOS_BASED_FILE_SYSTEM)
  4386. if (isalpha (path[0]) && path[1] == ':')
  4387. return xstrdup (path);
  4388. #endif
  4389. if (IS_DIR_SEPARATOR (path[0]))
  4390. return xstrdup (path);
  4391. /* prepend the current directory */
  4392. /* doesn't handle '~' */
  4393. if (getcwd (tmp, LT_PATHMAX) == NULL)
  4394. lt_fatal ("getcwd failed");
  4395. size = strlen(tmp) + 1 + strlen(path) + 1; /* +2 for '/' and '\0' */
  4396. p = XMALLOC(char, size);
  4397. sprintf(p, "%s%c%s", tmp, DIR_SEPARATOR, path);
  4398. return p;
  4399. }
  4400. char *
  4401. strendzap(char *str, const char *pat)
  4402. {
  4403. size_t len, patlen;
  4404. assert(str != NULL);
  4405. assert(pat != NULL);
  4406. len = strlen(str);
  4407. patlen = strlen(pat);
  4408. if (patlen <= len)
  4409. {
  4410. str += len - patlen;
  4411. if (strcmp(str, pat) == 0)
  4412. *str = '\0';
  4413. }
  4414. return str;
  4415. }
  4416. static void
  4417. lt_error_core (int exit_status, const char * mode,
  4418. const char * message, va_list ap)
  4419. {
  4420. fprintf (stderr, "%s: %s: ", program_name, mode);
  4421. vfprintf (stderr, message, ap);
  4422. fprintf (stderr, ".\n");
  4423. if (exit_status >= 0)
  4424. exit (exit_status);
  4425. }
  4426. void
  4427. lt_fatal (const char *message, ...)
  4428. {
  4429. va_list ap;
  4430. va_start (ap, message);
  4431. lt_error_core (EXIT_FAILURE, "FATAL", message, ap);
  4432. va_end (ap);
  4433. }
  4434. EOF
  4435. # we should really use a build-platform specific compiler
  4436. # here, but OTOH, the wrappers (shell script and this C one)
  4437. # are only useful if you want to execute the "real" binary.
  4438. # Since the "real" binary is built for $host, then this
  4439. # wrapper might as well be built for $host, too.
  4440. $run $LTCC -s -o $cwrapper $cwrappersource
  4441. ;;
  4442. esac
  4443. $rm $output
  4444. trap "$rm $output; exit $EXIT_FAILURE" 1 2 15
  4445. $echo > $output "\
  4446. #! $SHELL
  4447. # $output - temporary wrapper script for $objdir/$outputname
  4448. # Generated by $PROGRAM - GNU $PACKAGE $VERSION$TIMESTAMP
  4449. #
  4450. # The $output program cannot be directly executed until all the libtool
  4451. # libraries that it depends on are installed.
  4452. #
  4453. # This wrapper script should never be moved out of the build directory.
  4454. # If it is, it will not operate correctly.
  4455. # Sed substitution that helps us do robust quoting. It backslashifies
  4456. # metacharacters that are still active within double-quoted strings.
  4457. Xsed='${SED} -e 1s/^X//'
  4458. sed_quote_subst='$sed_quote_subst'
  4459. # The HP-UX ksh and POSIX shell print the target directory to stdout
  4460. # if CDPATH is set.
  4461. (unset CDPATH) >/dev/null 2>&1 && unset CDPATH
  4462. relink_command=\"$relink_command\"
  4463. # This environment variable determines our operation mode.
  4464. if test \"\$libtool_install_magic\" = \"$magic\"; then
  4465. # install mode needs the following variable:
  4466. notinst_deplibs='$notinst_deplibs'
  4467. else
  4468. # When we are sourced in execute mode, \$file and \$echo are already set.
  4469. if test \"\$libtool_execute_magic\" != \"$magic\"; then
  4470. echo=\"$qecho\"
  4471. file=\"\$0\"
  4472. # Make sure echo works.
  4473. if test \"X\$1\" = X--no-reexec; then
  4474. # Discard the --no-reexec flag, and continue.
  4475. shift
  4476. elif test \"X\`(\$echo '\t') 2>/dev/null\`\" = 'X\t'; then
  4477. # Yippee, \$echo works!
  4478. :
  4479. else
  4480. # Restart under the correct shell, and then maybe \$echo will work.
  4481. exec $SHELL \"\$0\" --no-reexec \${1+\"\$@\"}
  4482. fi
  4483. fi\
  4484. "
  4485. $echo >> $output "\
  4486. # Find the directory that this script lives in.
  4487. thisdir=\`\$echo \"X\$file\" | \$Xsed -e 's%/[^/]*$%%'\`
  4488. test \"x\$thisdir\" = \"x\$file\" && thisdir=.
  4489. # Follow symbolic links until we get to the real thisdir.
  4490. file=\`ls -ld \"\$file\" | ${SED} -n 's/.*-> //p'\`
  4491. while test -n \"\$file\"; do
  4492. destdir=\`\$echo \"X\$file\" | \$Xsed -e 's%/[^/]*\$%%'\`
  4493. # If there was a directory component, then change thisdir.
  4494. if test \"x\$destdir\" != \"x\$file\"; then
  4495. case \"\$destdir\" in
  4496. [\\\\/]* | [A-Za-z]:[\\\\/]*) thisdir=\"\$destdir\" ;;
  4497. *) thisdir=\"\$thisdir/\$destdir\" ;;
  4498. esac
  4499. fi
  4500. file=\`\$echo \"X\$file\" | \$Xsed -e 's%^.*/%%'\`
  4501. file=\`ls -ld \"\$thisdir/\$file\" | ${SED} -n 's/.*-> //p'\`
  4502. done
  4503. # Try to get the absolute directory name.
  4504. absdir=\`cd \"\$thisdir\" && pwd\`
  4505. test -n \"\$absdir\" && thisdir=\"\$absdir\"
  4506. "
  4507. if test "$fast_install" = yes; then
  4508. $echo >> $output "\
  4509. program=lt-'$outputname'$exeext
  4510. progdir=\"\$thisdir/$objdir\"
  4511. if test ! -f \"\$progdir/\$program\" || \\
  4512. { file=\`ls -1dt \"\$progdir/\$program\" \"\$progdir/../\$program\" 2>/dev/null | ${SED} 1q\`; \\
  4513. test \"X\$file\" != \"X\$progdir/\$program\"; }; then
  4514. file=\"\$\$-\$program\"
  4515. if test ! -d \"\$progdir\"; then
  4516. $mkdir \"\$progdir\"
  4517. else
  4518. $rm \"\$progdir/\$file\"
  4519. fi"
  4520. $echo >> $output "\
  4521. # relink executable if necessary
  4522. if test -n \"\$relink_command\"; then
  4523. if relink_command_output=\`eval \$relink_command 2>&1\`; then :
  4524. else
  4525. $echo \"\$relink_command_output\" >&2
  4526. $rm \"\$progdir/\$file\"
  4527. exit $EXIT_FAILURE
  4528. fi
  4529. fi
  4530. $mv \"\$progdir/\$file\" \"\$progdir/\$program\" 2>/dev/null ||
  4531. { $rm \"\$progdir/\$program\";
  4532. $mv \"\$progdir/\$file\" \"\$progdir/\$program\"; }
  4533. $rm \"\$progdir/\$file\"
  4534. fi"
  4535. else
  4536. $echo >> $output "\
  4537. program='$outputname'
  4538. progdir=\"\$thisdir/$objdir\"
  4539. "
  4540. fi
  4541. $echo >> $output "\
  4542. if test -f \"\$progdir/\$program\"; then"
  4543. # Export our shlibpath_var if we have one.
  4544. if test "$shlibpath_overrides_runpath" = yes && test -n "$shlibpath_var" && test -n "$temp_rpath"; then
  4545. $echo >> $output "\
  4546. # Add our own library path to $shlibpath_var
  4547. $shlibpath_var=\"$temp_rpath\$$shlibpath_var\"
  4548. # Some systems cannot cope with colon-terminated $shlibpath_var
  4549. # The second colon is a workaround for a bug in BeOS R4 sed
  4550. $shlibpath_var=\`\$echo \"X\$$shlibpath_var\" | \$Xsed -e 's/::*\$//'\`
  4551. export $shlibpath_var
  4552. "
  4553. fi
  4554. # fixup the dll searchpath if we need to.
  4555. if test -n "$dllsearchpath"; then
  4556. $echo >> $output "\
  4557. # Add the dll search path components to the executable PATH
  4558. PATH=$dllsearchpath:\$PATH
  4559. "
  4560. fi
  4561. $echo >> $output "\
  4562. if test \"\$libtool_execute_magic\" != \"$magic\"; then
  4563. # Run the actual program with our arguments.
  4564. "
  4565. case $host in
  4566. # Backslashes separate directories on plain windows
  4567. *-*-mingw | *-*-os2*)
  4568. $echo >> $output "\
  4569. exec \$progdir\\\\\$program \${1+\"\$@\"}
  4570. "
  4571. ;;
  4572. *)
  4573. $echo >> $output "\
  4574. exec \$progdir/\$program \${1+\"\$@\"}
  4575. "
  4576. ;;
  4577. esac
  4578. $echo >> $output "\
  4579. \$echo \"\$0: cannot exec \$program \${1+\"\$@\"}\"
  4580. exit $EXIT_FAILURE
  4581. fi
  4582. else
  4583. # The program doesn't exist.
  4584. \$echo \"\$0: error: \$progdir/\$program does not exist\" 1>&2
  4585. \$echo \"This script is just a wrapper for \$program.\" 1>&2
  4586. $echo \"See the $PACKAGE documentation for more information.\" 1>&2
  4587. exit $EXIT_FAILURE
  4588. fi
  4589. fi\
  4590. "
  4591. chmod +x $output
  4592. fi
  4593. exit $EXIT_SUCCESS
  4594. ;;
  4595. esac
  4596. # See if we need to build an old-fashioned archive.
  4597. for oldlib in $oldlibs; do
  4598. if test "$build_libtool_libs" = convenience; then
  4599. oldobjs="$libobjs_save"
  4600. addlibs="$convenience"
  4601. build_libtool_libs=no
  4602. else
  4603. if test "$build_libtool_libs" = module; then
  4604. oldobjs="$libobjs_save"
  4605. build_libtool_libs=no
  4606. else
  4607. oldobjs="$old_deplibs $non_pic_objects"
  4608. fi
  4609. addlibs="$old_convenience"
  4610. fi
  4611. if test -n "$addlibs"; then
  4612. gentop="$output_objdir/${outputname}x"
  4613. generated="$generated $gentop"
  4614. func_extract_archives $gentop $addlibs
  4615. oldobjs="$oldobjs $func_extract_archives_result"
  4616. fi
  4617. # Do each command in the archive commands.
  4618. if test -n "$old_archive_from_new_cmds" && test "$build_libtool_libs" = yes; then
  4619. cmds=$old_archive_from_new_cmds
  4620. else
  4621. eval cmds=\"$old_archive_cmds\"
  4622. if len=`expr "X$cmds" : ".*"` &&
  4623. test "$len" -le "$max_cmd_len" || test "$max_cmd_len" -le -1; then
  4624. cmds=$old_archive_cmds
  4625. else
  4626. # the command line is too long to link in one step, link in parts
  4627. $echo "using piecewise archive linking..."
  4628. save_RANLIB=$RANLIB
  4629. RANLIB=:
  4630. objlist=
  4631. concat_cmds=
  4632. save_oldobjs=$oldobjs
  4633. # GNU ar 2.10+ was changed to match POSIX; thus no paths are
  4634. # encoded into archives. This makes 'ar r' malfunction in
  4635. # this piecewise linking case whenever conflicting object
  4636. # names appear in distinct ar calls; check, warn and compensate.
  4637. if (for obj in $save_oldobjs
  4638. do
  4639. $echo "X$obj" | $Xsed -e 's%^.*/%%'
  4640. done | sort | sort -uc >/dev/null 2>&1); then
  4641. :
  4642. else
  4643. $echo "$modename: warning: object name conflicts; overriding AR_FLAGS to 'cq'" 1>&2
  4644. $echo "$modename: warning: to ensure that POSIX-compatible ar will work" 1>&2
  4645. AR_FLAGS=cq
  4646. fi
  4647. # Is there a better way of finding the last object in the list?
  4648. for obj in $save_oldobjs
  4649. do
  4650. last_oldobj=$obj
  4651. done
  4652. for obj in $save_oldobjs
  4653. do
  4654. oldobjs="$objlist $obj"
  4655. objlist="$objlist $obj"
  4656. eval test_cmds=\"$old_archive_cmds\"
  4657. if len=`expr "X$test_cmds" : ".*"` &&
  4658. test "$len" -le "$max_cmd_len"; then
  4659. :
  4660. else
  4661. # the above command should be used before it gets too long
  4662. oldobjs=$objlist
  4663. if test "$obj" = "$last_oldobj" ; then
  4664. RANLIB=$save_RANLIB
  4665. fi
  4666. test -z "$concat_cmds" || concat_cmds=$concat_cmds~
  4667. eval concat_cmds=\"\${concat_cmds}$old_archive_cmds\"
  4668. objlist=
  4669. fi
  4670. done
  4671. RANLIB=$save_RANLIB
  4672. oldobjs=$objlist
  4673. if test "X$oldobjs" = "X" ; then
  4674. eval cmds=\"\$concat_cmds\"
  4675. else
  4676. eval cmds=\"\$concat_cmds~\$old_archive_cmds\"
  4677. fi
  4678. fi
  4679. fi
  4680. save_ifs="$IFS"; IFS='~'
  4681. for cmd in $cmds; do
  4682. eval cmd=\"$cmd\"
  4683. IFS="$save_ifs"
  4684. $show "$cmd"
  4685. $run eval "$cmd" || exit $?
  4686. done
  4687. IFS="$save_ifs"
  4688. done
  4689. if test -n "$generated"; then
  4690. $show "${rm}r$generated"
  4691. $run ${rm}r$generated
  4692. fi
  4693. # Now create the libtool archive.
  4694. case $output in
  4695. *.la)
  4696. old_library=
  4697. test "$build_old_libs" = yes && old_library="$libname.$libext"
  4698. $show "creating $output"
  4699. # Preserve any variables that may affect compiler behavior
  4700. for var in $variables_saved_for_relink; do
  4701. if eval test -z \"\${$var+set}\"; then
  4702. relink_command="{ test -z \"\${$var+set}\" || unset $var || { $var=; export $var; }; }; $relink_command"
  4703. elif eval var_value=\$$var; test -z "$var_value"; then
  4704. relink_command="$var=; export $var; $relink_command"
  4705. else
  4706. var_value=`$echo "X$var_value" | $Xsed -e "$sed_quote_subst"`
  4707. relink_command="$var=\"$var_value\"; export $var; $relink_command"
  4708. fi
  4709. done
  4710. # Quote the link command for shipping.
  4711. relink_command="(cd `pwd`; $SHELL $progpath $preserve_args --mode=relink $libtool_args @inst_prefix_dir@)"
  4712. relink_command=`$echo "X$relink_command" | $Xsed -e "$sed_quote_subst"`
  4713. if test "$hardcode_automatic" = yes ; then
  4714. relink_command=
  4715. fi
  4716. # Only create the output if not a dry run.
  4717. if test -z "$run"; then
  4718. for installed in no yes; do
  4719. if test "$installed" = yes; then
  4720. if test -z "$install_libdir"; then
  4721. break
  4722. fi
  4723. output="$output_objdir/$outputname"i
  4724. # Replace all uninstalled libtool libraries with the installed ones
  4725. newdependency_libs=
  4726. for deplib in $dependency_libs; do
  4727. case $deplib in
  4728. *.la)
  4729. name=`$echo "X$deplib" | $Xsed -e 's%^.*/%%'`
  4730. eval libdir=`${SED} -n -e 's/^libdir=\(.*\)$/\1/p' $deplib`
  4731. if test -z "$libdir"; then
  4732. $echo "$modename: \`$deplib' is not a valid libtool archive" 1>&2
  4733. exit $EXIT_FAILURE
  4734. fi
  4735. newdependency_libs="$newdependency_libs $libdir/$name"
  4736. ;;
  4737. *) newdependency_libs="$newdependency_libs $deplib" ;;
  4738. esac
  4739. done
  4740. dependency_libs="$newdependency_libs"
  4741. newdlfiles=
  4742. for lib in $dlfiles; do
  4743. name=`$echo "X$lib" | $Xsed -e 's%^.*/%%'`
  4744. eval libdir=`${SED} -n -e 's/^libdir=\(.*\)$/\1/p' $lib`
  4745. if test -z "$libdir"; then
  4746. $echo "$modename: \`$lib' is not a valid libtool archive" 1>&2
  4747. exit $EXIT_FAILURE
  4748. fi
  4749. newdlfiles="$newdlfiles $libdir/$name"
  4750. done
  4751. dlfiles="$newdlfiles"
  4752. newdlprefiles=
  4753. for lib in $dlprefiles; do
  4754. name=`$echo "X$lib" | $Xsed -e 's%^.*/%%'`
  4755. eval libdir=`${SED} -n -e 's/^libdir=\(.*\)$/\1/p' $lib`
  4756. if test -z "$libdir"; then
  4757. $echo "$modename: \`$lib' is not a valid libtool archive" 1>&2
  4758. exit $EXIT_FAILURE
  4759. fi
  4760. newdlprefiles="$newdlprefiles $libdir/$name"
  4761. done
  4762. dlprefiles="$newdlprefiles"
  4763. else
  4764. newdlfiles=
  4765. for lib in $dlfiles; do
  4766. case $lib in
  4767. [\\/]* | [A-Za-z]:[\\/]*) abs="$lib" ;;
  4768. *) abs=`pwd`"/$lib" ;;
  4769. esac
  4770. newdlfiles="$newdlfiles $abs"
  4771. done
  4772. dlfiles="$newdlfiles"
  4773. newdlprefiles=
  4774. for lib in $dlprefiles; do
  4775. case $lib in
  4776. [\\/]* | [A-Za-z]:[\\/]*) abs="$lib" ;;
  4777. *) abs=`pwd`"/$lib" ;;
  4778. esac
  4779. newdlprefiles="$newdlprefiles $abs"
  4780. done
  4781. dlprefiles="$newdlprefiles"
  4782. fi
  4783. $rm $output
  4784. # place dlname in correct position for cygwin
  4785. tdlname=$dlname
  4786. case $host,$output,$installed,$module,$dlname in
  4787. *cygwin*,*lai,yes,no,*.dll | *mingw*,*lai,yes,no,*.dll) tdlname=../bin/$dlname ;;
  4788. esac
  4789. $echo > $output "\
  4790. # $outputname - a libtool library file
  4791. # Generated by $PROGRAM - GNU $PACKAGE $VERSION$TIMESTAMP
  4792. #
  4793. # Please DO NOT delete this file!
  4794. # It is necessary for linking the library.
  4795. # The name that we can dlopen(3).
  4796. dlname='$tdlname'
  4797. # Names of this library.
  4798. library_names='$library_names'
  4799. # The name of the static archive.
  4800. old_library='$old_library'
  4801. # Libraries that this one depends upon.
  4802. dependency_libs='$dependency_libs'
  4803. # Version information for $libname.
  4804. current=$current
  4805. age=$age
  4806. revision=$revision
  4807. # Is this an already installed library?
  4808. installed=$installed
  4809. # Should we warn about portability when linking against -modules?
  4810. shouldnotlink=$module
  4811. # Files to dlopen/dlpreopen
  4812. dlopen='$dlfiles'
  4813. dlpreopen='$dlprefiles'
  4814. # Directory that this library needs to be installed in:
  4815. libdir='$install_libdir'"
  4816. if test "$installed" = no && test "$need_relink" = yes; then
  4817. $echo >> $output "\
  4818. relink_command=\"$relink_command\""
  4819. fi
  4820. done
  4821. fi
  4822. # Do a symbolic link so that the libtool archive can be found in
  4823. # LD_LIBRARY_PATH before the program is installed.
  4824. $show "(cd $output_objdir && $rm $outputname && $LN_S ../$outputname $outputname)"
  4825. $run eval '(cd $output_objdir && $rm $outputname && $LN_S ../$outputname $outputname)' || exit $?
  4826. ;;
  4827. esac
  4828. exit $EXIT_SUCCESS
  4829. ;;
  4830. # libtool install mode
  4831. install)
  4832. modename="$modename: install"
  4833. # There may be an optional sh(1) argument at the beginning of
  4834. # install_prog (especially on Windows NT).
  4835. if test "$nonopt" = "$SHELL" || test "$nonopt" = /bin/sh ||
  4836. # Allow the use of GNU shtool's install command.
  4837. $echo "X$nonopt" | $Xsed | grep shtool > /dev/null; then
  4838. # Aesthetically quote it.
  4839. arg=`$echo "X$nonopt" | $Xsed -e "$sed_quote_subst"`
  4840. case $arg in
  4841. *$quote_scanset* | *]* | *\|* | *\&* | *\(* | *\)* | "")
  4842. arg="\"$arg\""
  4843. ;;
  4844. esac
  4845. install_prog="$arg "
  4846. arg="$1"
  4847. shift
  4848. else
  4849. install_prog=
  4850. arg="$nonopt"
  4851. fi
  4852. # The real first argument should be the name of the installation program.
  4853. # Aesthetically quote it.
  4854. arg=`$echo "X$arg" | $Xsed -e "$sed_quote_subst"`
  4855. case $arg in
  4856. *$quote_scanset* | *]* | *\|* | *\&* | *\(* | *\)* | "")
  4857. arg="\"$arg\""
  4858. ;;
  4859. esac
  4860. install_prog="$install_prog$arg"
  4861. # We need to accept at least all the BSD install flags.
  4862. dest=
  4863. files=
  4864. opts=
  4865. prev=
  4866. install_type=
  4867. isdir=no
  4868. stripme=
  4869. for arg
  4870. do
  4871. if test -n "$dest"; then
  4872. files="$files $dest"
  4873. dest="$arg"
  4874. continue
  4875. fi
  4876. case $arg in
  4877. -d) isdir=yes ;;
  4878. -f) prev="-f" ;;
  4879. -g) prev="-g" ;;
  4880. -m) prev="-m" ;;
  4881. -o) prev="-o" ;;
  4882. -s)
  4883. stripme=" -s"
  4884. continue
  4885. ;;
  4886. -*) ;;
  4887. *)
  4888. # If the previous option needed an argument, then skip it.
  4889. if test -n "$prev"; then
  4890. prev=
  4891. else
  4892. dest="$arg"
  4893. continue
  4894. fi
  4895. ;;
  4896. esac
  4897. # Aesthetically quote the argument.
  4898. arg=`$echo "X$arg" | $Xsed -e "$sed_quote_subst"`
  4899. case $arg in
  4900. *$quote_scanset* | *]* | *\|* | *\&* | *\(* | *\)* | "")
  4901. arg="\"$arg\""
  4902. ;;
  4903. esac
  4904. install_prog="$install_prog $arg"
  4905. done
  4906. if test -z "$install_prog"; then
  4907. $echo "$modename: you must specify an install program" 1>&2
  4908. $echo "$help" 1>&2
  4909. exit $EXIT_FAILURE
  4910. fi
  4911. if test -n "$prev"; then
  4912. $echo "$modename: the \`$prev' option requires an argument" 1>&2
  4913. $echo "$help" 1>&2
  4914. exit $EXIT_FAILURE
  4915. fi
  4916. if test -z "$files"; then
  4917. if test -z "$dest"; then
  4918. $echo "$modename: no file or destination specified" 1>&2
  4919. else
  4920. $echo "$modename: you must specify a destination" 1>&2
  4921. fi
  4922. $echo "$help" 1>&2
  4923. exit $EXIT_FAILURE
  4924. fi
  4925. # Strip any trailing slash from the destination.
  4926. dest=`$echo "X$dest" | $Xsed -e 's%/$%%'`
  4927. # Check to see that the destination is a directory.
  4928. test -d "$dest" && isdir=yes
  4929. if test "$isdir" = yes; then
  4930. destdir="$dest"
  4931. destname=
  4932. else
  4933. destdir=`$echo "X$dest" | $Xsed -e 's%/[^/]*$%%'`
  4934. test "X$destdir" = "X$dest" && destdir=.
  4935. destname=`$echo "X$dest" | $Xsed -e 's%^.*/%%'`
  4936. # Not a directory, so check to see that there is only one file specified.
  4937. set dummy $files
  4938. if test "$#" -gt 2; then
  4939. $echo "$modename: \`$dest' is not a directory" 1>&2
  4940. $echo "$help" 1>&2
  4941. exit $EXIT_FAILURE
  4942. fi
  4943. fi
  4944. case $destdir in
  4945. [\\/]* | [A-Za-z]:[\\/]*) ;;
  4946. *)
  4947. for file in $files; do
  4948. case $file in
  4949. *.lo) ;;
  4950. *)
  4951. $echo "$modename: \`$destdir' must be an absolute directory name" 1>&2
  4952. $echo "$help" 1>&2
  4953. exit $EXIT_FAILURE
  4954. ;;
  4955. esac
  4956. done
  4957. ;;
  4958. esac
  4959. # This variable tells wrapper scripts just to set variables rather
  4960. # than running their programs.
  4961. libtool_install_magic="$magic"
  4962. staticlibs=
  4963. future_libdirs=
  4964. current_libdirs=
  4965. for file in $files; do
  4966. # Do each installation.
  4967. case $file in
  4968. *.$libext)
  4969. # Do the static libraries later.
  4970. staticlibs="$staticlibs $file"
  4971. ;;
  4972. *.la)
  4973. # Check to see that this really is a libtool archive.
  4974. if (${SED} -e '2q' $file | grep "^# Generated by .*$PACKAGE") >/dev/null 2>&1; then :
  4975. else
  4976. $echo "$modename: \`$file' is not a valid libtool archive" 1>&2
  4977. $echo "$help" 1>&2
  4978. exit $EXIT_FAILURE
  4979. fi
  4980. library_names=
  4981. old_library=
  4982. relink_command=
  4983. # If there is no directory component, then add one.
  4984. case $file in
  4985. */* | *\\*) . $file ;;
  4986. *) . ./$file ;;
  4987. esac
  4988. # Add the libdir to current_libdirs if it is the destination.
  4989. if test "X$destdir" = "X$libdir"; then
  4990. case "$current_libdirs " in
  4991. *" $libdir "*) ;;
  4992. *) current_libdirs="$current_libdirs $libdir" ;;
  4993. esac
  4994. else
  4995. # Note the libdir as a future libdir.
  4996. case "$future_libdirs " in
  4997. *" $libdir "*) ;;
  4998. *) future_libdirs="$future_libdirs $libdir" ;;
  4999. esac
  5000. fi
  5001. dir=`$echo "X$file" | $Xsed -e 's%/[^/]*$%%'`/
  5002. test "X$dir" = "X$file/" && dir=
  5003. dir="$dir$objdir"
  5004. if test -n "$relink_command"; then
  5005. # Determine the prefix the user has applied to our future dir.
  5006. inst_prefix_dir=`$echo "$destdir" | $SED "s%$libdir\$%%"`
  5007. # Don't allow the user to place us outside of our expected
  5008. # location b/c this prevents finding dependent libraries that
  5009. # are installed to the same prefix.
  5010. # At present, this check doesn't affect windows .dll's that
  5011. # are installed into $libdir/../bin (currently, that works fine)
  5012. # but it's something to keep an eye on.
  5013. if test "$inst_prefix_dir" = "$destdir"; then
  5014. $echo "$modename: error: cannot install \`$file' to a directory not ending in $libdir" 1>&2
  5015. exit $EXIT_FAILURE
  5016. fi
  5017. if test -n "$inst_prefix_dir"; then
  5018. # Stick the inst_prefix_dir data into the link command.
  5019. relink_command=`$echo "$relink_command" | $SED "s%@inst_prefix_dir@%-inst-prefix-dir $inst_prefix_dir%"`
  5020. else
  5021. relink_command=`$echo "$relink_command" | $SED "s%@inst_prefix_dir@%%"`
  5022. fi
  5023. $echo "$modename: warning: relinking \`$file'" 1>&2
  5024. $show "$relink_command"
  5025. if $run eval "$relink_command"; then :
  5026. else
  5027. $echo "$modename: error: relink \`$file' with the above command before installing it" 1>&2
  5028. exit $EXIT_FAILURE
  5029. fi
  5030. fi
  5031. # See the names of the shared library.
  5032. set dummy $library_names
  5033. if test -n "$2"; then
  5034. realname="$2"
  5035. shift
  5036. shift
  5037. srcname="$realname"
  5038. test -n "$relink_command" && srcname="$realname"T
  5039. # Install the shared library and build the symlinks.
  5040. $show "$install_prog $dir/$srcname $destdir/$realname"
  5041. $run eval "$install_prog $dir/$srcname $destdir/$realname" || exit $?
  5042. if test -n "$stripme" && test -n "$striplib"; then
  5043. $show "$striplib $destdir/$realname"
  5044. $run eval "$striplib $destdir/$realname" || exit $?
  5045. fi
  5046. if test "$#" -gt 0; then
  5047. # Delete the old symlinks, and create new ones.
  5048. for linkname
  5049. do
  5050. if test "$linkname" != "$realname"; then
  5051. $show "(cd $destdir && $rm $linkname && $LN_S $realname $linkname)"
  5052. $run eval "(cd $destdir && $rm $linkname && $LN_S $realname $linkname)"
  5053. fi
  5054. done
  5055. fi
  5056. # Do each command in the postinstall commands.
  5057. lib="$destdir/$realname"
  5058. cmds=$postinstall_cmds
  5059. save_ifs="$IFS"; IFS='~'
  5060. for cmd in $cmds; do
  5061. IFS="$save_ifs"
  5062. eval cmd=\"$cmd\"
  5063. $show "$cmd"
  5064. $run eval "$cmd" || exit $?
  5065. done
  5066. IFS="$save_ifs"
  5067. fi
  5068. # Install the pseudo-library for information purposes.
  5069. name=`$echo "X$file" | $Xsed -e 's%^.*/%%'`
  5070. instname="$dir/$name"i
  5071. $show "$install_prog $instname $destdir/$name"
  5072. $run eval "$install_prog $instname $destdir/$name" || exit $?
  5073. # Maybe install the static library, too.
  5074. test -n "$old_library" && staticlibs="$staticlibs $dir/$old_library"
  5075. ;;
  5076. *.lo)
  5077. # Install (i.e. copy) a libtool object.
  5078. # Figure out destination file name, if it wasn't already specified.
  5079. if test -n "$destname"; then
  5080. destfile="$destdir/$destname"
  5081. else
  5082. destfile=`$echo "X$file" | $Xsed -e 's%^.*/%%'`
  5083. destfile="$destdir/$destfile"
  5084. fi
  5085. # Deduce the name of the destination old-style object file.
  5086. case $destfile in
  5087. *.lo)
  5088. staticdest=`$echo "X$destfile" | $Xsed -e "$lo2o"`
  5089. ;;
  5090. *.$objext)
  5091. staticdest="$destfile"
  5092. destfile=
  5093. ;;
  5094. *)
  5095. $echo "$modename: cannot copy a libtool object to \`$destfile'" 1>&2
  5096. $echo "$help" 1>&2
  5097. exit $EXIT_FAILURE
  5098. ;;
  5099. esac
  5100. # Install the libtool object if requested.
  5101. if test -n "$destfile"; then
  5102. $show "$install_prog $file $destfile"
  5103. $run eval "$install_prog $file $destfile" || exit $?
  5104. fi
  5105. # Install the old object if enabled.
  5106. if test "$build_old_libs" = yes; then
  5107. # Deduce the name of the old-style object file.
  5108. staticobj=`$echo "X$file" | $Xsed -e "$lo2o"`
  5109. $show "$install_prog $staticobj $staticdest"
  5110. $run eval "$install_prog \$staticobj \$staticdest" || exit $?
  5111. fi
  5112. exit $EXIT_SUCCESS
  5113. ;;
  5114. *)
  5115. # Figure out destination file name, if it wasn't already specified.
  5116. if test -n "$destname"; then
  5117. destfile="$destdir/$destname"
  5118. else
  5119. destfile=`$echo "X$file" | $Xsed -e 's%^.*/%%'`
  5120. destfile="$destdir/$destfile"
  5121. fi
  5122. # If the file is missing, and there is a .exe on the end, strip it
  5123. # because it is most likely a libtool script we actually want to
  5124. # install
  5125. stripped_ext=""
  5126. case $file in
  5127. *.exe)
  5128. if test ! -f "$file"; then
  5129. file=`$echo $file|${SED} 's,.exe$,,'`
  5130. stripped_ext=".exe"
  5131. fi
  5132. ;;
  5133. esac
  5134. # Do a test to see if this is really a libtool program.
  5135. case $host in
  5136. *cygwin*|*mingw*)
  5137. wrapper=`$echo $file | ${SED} -e 's,.exe$,,'`
  5138. ;;
  5139. *)
  5140. wrapper=$file
  5141. ;;
  5142. esac
  5143. if (${SED} -e '4q' $wrapper | grep "^# Generated by .*$PACKAGE")>/dev/null 2>&1; then
  5144. notinst_deplibs=
  5145. relink_command=
  5146. # To insure that "foo" is sourced, and not "foo.exe",
  5147. # finese the cygwin/MSYS system by explicitly sourcing "foo."
  5148. # which disallows the automatic-append-.exe behavior.
  5149. case $build in
  5150. *cygwin* | *mingw*) wrapperdot=${wrapper}. ;;
  5151. *) wrapperdot=${wrapper} ;;
  5152. esac
  5153. # If there is no directory component, then add one.
  5154. case $file in
  5155. */* | *\\*) . ${wrapperdot} ;;
  5156. *) . ./${wrapperdot} ;;
  5157. esac
  5158. # Check the variables that should have been set.
  5159. if test -z "$notinst_deplibs"; then
  5160. $echo "$modename: invalid libtool wrapper script \`$wrapper'" 1>&2
  5161. exit $EXIT_FAILURE
  5162. fi
  5163. finalize=yes
  5164. for lib in $notinst_deplibs; do
  5165. # Check to see that each library is installed.
  5166. libdir=
  5167. if test -f "$lib"; then
  5168. # If there is no directory component, then add one.
  5169. case $lib in
  5170. */* | *\\*) . $lib ;;
  5171. *) . ./$lib ;;
  5172. esac
  5173. fi
  5174. libfile="$libdir/"`$echo "X$lib" | $Xsed -e 's%^.*/%%g'` ### testsuite: skip nested quoting test
  5175. if test -n "$libdir" && test ! -f "$libfile"; then
  5176. $echo "$modename: warning: \`$lib' has not been installed in \`$libdir'" 1>&2
  5177. finalize=no
  5178. fi
  5179. done
  5180. relink_command=
  5181. # To insure that "foo" is sourced, and not "foo.exe",
  5182. # finese the cygwin/MSYS system by explicitly sourcing "foo."
  5183. # which disallows the automatic-append-.exe behavior.
  5184. case $build in
  5185. *cygwin* | *mingw*) wrapperdot=${wrapper}. ;;
  5186. *) wrapperdot=${wrapper} ;;
  5187. esac
  5188. # If there is no directory component, then add one.
  5189. case $file in
  5190. */* | *\\*) . ${wrapperdot} ;;
  5191. *) . ./${wrapperdot} ;;
  5192. esac
  5193. outputname=
  5194. if test "$fast_install" = no && test -n "$relink_command"; then
  5195. if test "$finalize" = yes && test -z "$run"; then
  5196. tmpdir="/tmp"
  5197. test -n "$TMPDIR" && tmpdir="$TMPDIR"
  5198. tmpdir="$tmpdir/libtool-$$"
  5199. save_umask=`umask`
  5200. umask 0077
  5201. if $mkdir "$tmpdir"; then
  5202. umask $save_umask
  5203. else
  5204. umask $save_umask
  5205. $echo "$modename: error: cannot create temporary directory \`$tmpdir'" 1>&2
  5206. continue
  5207. fi
  5208. file=`$echo "X$file$stripped_ext" | $Xsed -e 's%^.*/%%'`
  5209. outputname="$tmpdir/$file"
  5210. # Replace the output file specification.
  5211. relink_command=`$echo "X$relink_command" | $Xsed -e 's%@OUTPUT@%'"$outputname"'%g'`
  5212. $show "$relink_command"
  5213. if $run eval "$relink_command"; then :
  5214. else
  5215. $echo "$modename: error: relink \`$file' with the above command before installing it" 1>&2
  5216. ${rm}r "$tmpdir"
  5217. continue
  5218. fi
  5219. file="$outputname"
  5220. else
  5221. $echo "$modename: warning: cannot relink \`$file'" 1>&2
  5222. fi
  5223. else
  5224. # Install the binary that we compiled earlier.
  5225. file=`$echo "X$file$stripped_ext" | $Xsed -e "s%\([^/]*\)$%$objdir/\1%"`
  5226. fi
  5227. fi
  5228. # remove .exe since cygwin /usr/bin/install will append another
  5229. # one anyways
  5230. case $install_prog,$host in
  5231. */usr/bin/install*,*cygwin*)
  5232. case $file:$destfile in
  5233. *.exe:*.exe)
  5234. # this is ok
  5235. ;;
  5236. *.exe:*)
  5237. destfile=$destfile.exe
  5238. ;;
  5239. *:*.exe)
  5240. destfile=`$echo $destfile | ${SED} -e 's,.exe$,,'`
  5241. ;;
  5242. esac
  5243. ;;
  5244. esac
  5245. $show "$install_prog$stripme $file $destfile"
  5246. $run eval "$install_prog\$stripme \$file \$destfile" || exit $?
  5247. test -n "$outputname" && ${rm}r "$tmpdir"
  5248. ;;
  5249. esac
  5250. done
  5251. for file in $staticlibs; do
  5252. name=`$echo "X$file" | $Xsed -e 's%^.*/%%'`
  5253. # Set up the ranlib parameters.
  5254. oldlib="$destdir/$name"
  5255. $show "$install_prog $file $oldlib"
  5256. $run eval "$install_prog \$file \$oldlib" || exit $?
  5257. if test -n "$stripme" && test -n "$old_striplib"; then
  5258. $show "$old_striplib $oldlib"
  5259. $run eval "$old_striplib $oldlib" || exit $?
  5260. fi
  5261. # Do each command in the postinstall commands.
  5262. cmds=$old_postinstall_cmds
  5263. save_ifs="$IFS"; IFS='~'
  5264. for cmd in $cmds; do
  5265. IFS="$save_ifs"
  5266. eval cmd=\"$cmd\"
  5267. $show "$cmd"
  5268. $run eval "$cmd" || exit $?
  5269. done
  5270. IFS="$save_ifs"
  5271. done
  5272. if test -n "$future_libdirs"; then
  5273. $echo "$modename: warning: remember to run \`$progname --finish$future_libdirs'" 1>&2
  5274. fi
  5275. if test -n "$current_libdirs"; then
  5276. # Maybe just do a dry run.
  5277. test -n "$run" && current_libdirs=" -n$current_libdirs"
  5278. exec_cmd='$SHELL $progpath $preserve_args --finish$current_libdirs'
  5279. else
  5280. exit $EXIT_SUCCESS
  5281. fi
  5282. ;;
  5283. # libtool finish mode
  5284. finish)
  5285. modename="$modename: finish"
  5286. libdirs="$nonopt"
  5287. admincmds=
  5288. if test -n "$finish_cmds$finish_eval" && test -n "$libdirs"; then
  5289. for dir
  5290. do
  5291. libdirs="$libdirs $dir"
  5292. done
  5293. for libdir in $libdirs; do
  5294. if test -n "$finish_cmds"; then
  5295. # Do each command in the finish commands.
  5296. cmds=$finish_cmds
  5297. save_ifs="$IFS"; IFS='~'
  5298. for cmd in $cmds; do
  5299. IFS="$save_ifs"
  5300. eval cmd=\"$cmd\"
  5301. $show "$cmd"
  5302. $run eval "$cmd" || admincmds="$admincmds
  5303. $cmd"
  5304. done
  5305. IFS="$save_ifs"
  5306. fi
  5307. if test -n "$finish_eval"; then
  5308. # Do the single finish_eval.
  5309. eval cmds=\"$finish_eval\"
  5310. $run eval "$cmds" || admincmds="$admincmds
  5311. $cmds"
  5312. fi
  5313. done
  5314. fi
  5315. # Exit here if they wanted silent mode.
  5316. test "$show" = : && exit $EXIT_SUCCESS
  5317. $echo "----------------------------------------------------------------------"
  5318. $echo "Libraries have been installed in:"
  5319. for libdir in $libdirs; do
  5320. $echo " $libdir"
  5321. done
  5322. $echo
  5323. $echo "If you ever happen to want to link against installed libraries"
  5324. $echo "in a given directory, LIBDIR, you must either use libtool, and"
  5325. $echo "specify the full pathname of the library, or use the \`-LLIBDIR'"
  5326. $echo "flag during linking and do at least one of the following:"
  5327. if test -n "$shlibpath_var"; then
  5328. $echo " - add LIBDIR to the \`$shlibpath_var' environment variable"
  5329. $echo " during execution"
  5330. fi
  5331. if test -n "$runpath_var"; then
  5332. $echo " - add LIBDIR to the \`$runpath_var' environment variable"
  5333. $echo " during linking"
  5334. fi
  5335. if test -n "$hardcode_libdir_flag_spec"; then
  5336. libdir=LIBDIR
  5337. eval flag=\"$hardcode_libdir_flag_spec\"
  5338. $echo " - use the \`$flag' linker flag"
  5339. fi
  5340. if test -n "$admincmds"; then
  5341. $echo " - have your system administrator run these commands:$admincmds"
  5342. fi
  5343. if test -f /etc/ld.so.conf; then
  5344. $echo " - have your system administrator add LIBDIR to \`/etc/ld.so.conf'"
  5345. fi
  5346. $echo
  5347. $echo "See any operating system documentation about shared libraries for"
  5348. $echo "more information, such as the ld(1) and ld.so(8) manual pages."
  5349. $echo "----------------------------------------------------------------------"
  5350. exit $EXIT_SUCCESS
  5351. ;;
  5352. # libtool execute mode
  5353. execute)
  5354. modename="$modename: execute"
  5355. # The first argument is the command name.
  5356. cmd="$nonopt"
  5357. if test -z "$cmd"; then
  5358. $echo "$modename: you must specify a COMMAND" 1>&2
  5359. $echo "$help"
  5360. exit $EXIT_FAILURE
  5361. fi
  5362. # Handle -dlopen flags immediately.
  5363. for file in $execute_dlfiles; do
  5364. if test ! -f "$file"; then
  5365. $echo "$modename: \`$file' is not a file" 1>&2
  5366. $echo "$help" 1>&2
  5367. exit $EXIT_FAILURE
  5368. fi
  5369. dir=
  5370. case $file in
  5371. *.la)
  5372. # Check to see that this really is a libtool archive.
  5373. if (${SED} -e '2q' $file | grep "^# Generated by .*$PACKAGE") >/dev/null 2>&1; then :
  5374. else
  5375. $echo "$modename: \`$lib' is not a valid libtool archive" 1>&2
  5376. $echo "$help" 1>&2
  5377. exit $EXIT_FAILURE
  5378. fi
  5379. # Read the libtool library.
  5380. dlname=
  5381. library_names=
  5382. # If there is no directory component, then add one.
  5383. case $file in
  5384. */* | *\\*) . $file ;;
  5385. *) . ./$file ;;
  5386. esac
  5387. # Skip this library if it cannot be dlopened.
  5388. if test -z "$dlname"; then
  5389. # Warn if it was a shared library.
  5390. test -n "$library_names" && $echo "$modename: warning: \`$file' was not linked with \`-export-dynamic'"
  5391. continue
  5392. fi
  5393. dir=`$echo "X$file" | $Xsed -e 's%/[^/]*$%%'`
  5394. test "X$dir" = "X$file" && dir=.
  5395. if test -f "$dir/$objdir/$dlname"; then
  5396. dir="$dir/$objdir"
  5397. else
  5398. $echo "$modename: cannot find \`$dlname' in \`$dir' or \`$dir/$objdir'" 1>&2
  5399. exit $EXIT_FAILURE
  5400. fi
  5401. ;;
  5402. *.lo)
  5403. # Just add the directory containing the .lo file.
  5404. dir=`$echo "X$file" | $Xsed -e 's%/[^/]*$%%'`
  5405. test "X$dir" = "X$file" && dir=.
  5406. ;;
  5407. *)
  5408. $echo "$modename: warning \`-dlopen' is ignored for non-libtool libraries and objects" 1>&2
  5409. continue
  5410. ;;
  5411. esac
  5412. # Get the absolute pathname.
  5413. absdir=`cd "$dir" && pwd`
  5414. test -n "$absdir" && dir="$absdir"
  5415. # Now add the directory to shlibpath_var.
  5416. if eval "test -z \"\$$shlibpath_var\""; then
  5417. eval "$shlibpath_var=\"\$dir\""
  5418. else
  5419. eval "$shlibpath_var=\"\$dir:\$$shlibpath_var\""
  5420. fi
  5421. done
  5422. # This variable tells wrapper scripts just to set shlibpath_var
  5423. # rather than running their programs.
  5424. libtool_execute_magic="$magic"
  5425. # Check if any of the arguments is a wrapper script.
  5426. args=
  5427. for file
  5428. do
  5429. case $file in
  5430. -*) ;;
  5431. *)
  5432. # Do a test to see if this is really a libtool program.
  5433. if (${SED} -e '4q' $file | grep "^# Generated by .*$PACKAGE") >/dev/null 2>&1; then
  5434. # If there is no directory component, then add one.
  5435. case $file in
  5436. */* | *\\*) . $file ;;
  5437. *) . ./$file ;;
  5438. esac
  5439. # Transform arg to wrapped name.
  5440. file="$progdir/$program"
  5441. fi
  5442. ;;
  5443. esac
  5444. # Quote arguments (to preserve shell metacharacters).
  5445. file=`$echo "X$file" | $Xsed -e "$sed_quote_subst"`
  5446. args="$args \"$file\""
  5447. done
  5448. if test -z "$run"; then
  5449. if test -n "$shlibpath_var"; then
  5450. # Export the shlibpath_var.
  5451. eval "export $shlibpath_var"
  5452. fi
  5453. # Restore saved environment variables
  5454. if test "${save_LC_ALL+set}" = set; then
  5455. LC_ALL="$save_LC_ALL"; export LC_ALL
  5456. fi
  5457. if test "${save_LANG+set}" = set; then
  5458. LANG="$save_LANG"; export LANG
  5459. fi
  5460. # Now prepare to actually exec the command.
  5461. exec_cmd="\$cmd$args"
  5462. else
  5463. # Display what would be done.
  5464. if test -n "$shlibpath_var"; then
  5465. eval "\$echo \"\$shlibpath_var=\$$shlibpath_var\""
  5466. $echo "export $shlibpath_var"
  5467. fi
  5468. $echo "$cmd$args"
  5469. exit $EXIT_SUCCESS
  5470. fi
  5471. ;;
  5472. # libtool clean and uninstall mode
  5473. clean | uninstall)
  5474. modename="$modename: $mode"
  5475. rm="$nonopt"
  5476. files=
  5477. rmforce=
  5478. exit_status=0
  5479. # This variable tells wrapper scripts just to set variables rather
  5480. # than running their programs.
  5481. libtool_install_magic="$magic"
  5482. for arg
  5483. do
  5484. case $arg in
  5485. -f) rm="$rm $arg"; rmforce=yes ;;
  5486. -*) rm="$rm $arg" ;;
  5487. *) files="$files $arg" ;;
  5488. esac
  5489. done
  5490. if test -z "$rm"; then
  5491. $echo "$modename: you must specify an RM program" 1>&2
  5492. $echo "$help" 1>&2
  5493. exit $EXIT_FAILURE
  5494. fi
  5495. rmdirs=
  5496. origobjdir="$objdir"
  5497. for file in $files; do
  5498. dir=`$echo "X$file" | $Xsed -e 's%/[^/]*$%%'`
  5499. if test "X$dir" = "X$file"; then
  5500. dir=.
  5501. objdir="$origobjdir"
  5502. else
  5503. objdir="$dir/$origobjdir"
  5504. fi
  5505. name=`$echo "X$file" | $Xsed -e 's%^.*/%%'`
  5506. test "$mode" = uninstall && objdir="$dir"
  5507. # Remember objdir for removal later, being careful to avoid duplicates
  5508. if test "$mode" = clean; then
  5509. case " $rmdirs " in
  5510. *" $objdir "*) ;;
  5511. *) rmdirs="$rmdirs $objdir" ;;
  5512. esac
  5513. fi
  5514. # Don't error if the file doesn't exist and rm -f was used.
  5515. if (test -L "$file") >/dev/null 2>&1 \
  5516. || (test -h "$file") >/dev/null 2>&1 \
  5517. || test -f "$file"; then
  5518. :
  5519. elif test -d "$file"; then
  5520. exit_status=1
  5521. continue
  5522. elif test "$rmforce" = yes; then
  5523. continue
  5524. fi
  5525. rmfiles="$file"
  5526. case $name in
  5527. *.la)
  5528. # Possibly a libtool archive, so verify it.
  5529. if (${SED} -e '2q' $file | grep "^# Generated by .*$PACKAGE") >/dev/null 2>&1; then
  5530. . $dir/$name
  5531. # Delete the libtool libraries and symlinks.
  5532. for n in $library_names; do
  5533. rmfiles="$rmfiles $objdir/$n"
  5534. done
  5535. test -n "$old_library" && rmfiles="$rmfiles $objdir/$old_library"
  5536. test "$mode" = clean && rmfiles="$rmfiles $objdir/$name $objdir/${name}i"
  5537. if test "$mode" = uninstall; then
  5538. if test -n "$library_names"; then
  5539. # Do each command in the postuninstall commands.
  5540. cmds=$postuninstall_cmds
  5541. save_ifs="$IFS"; IFS='~'
  5542. for cmd in $cmds; do
  5543. IFS="$save_ifs"
  5544. eval cmd=\"$cmd\"
  5545. $show "$cmd"
  5546. $run eval "$cmd"
  5547. if test "$?" -ne 0 && test "$rmforce" != yes; then
  5548. exit_status=1
  5549. fi
  5550. done
  5551. IFS="$save_ifs"
  5552. fi
  5553. if test -n "$old_library"; then
  5554. # Do each command in the old_postuninstall commands.
  5555. cmds=$old_postuninstall_cmds
  5556. save_ifs="$IFS"; IFS='~'
  5557. for cmd in $cmds; do
  5558. IFS="$save_ifs"
  5559. eval cmd=\"$cmd\"
  5560. $show "$cmd"
  5561. $run eval "$cmd"
  5562. if test "$?" -ne 0 && test "$rmforce" != yes; then
  5563. exit_status=1
  5564. fi
  5565. done
  5566. IFS="$save_ifs"
  5567. fi
  5568. # FIXME: should reinstall the best remaining shared library.
  5569. fi
  5570. fi
  5571. ;;
  5572. *.lo)
  5573. # Possibly a libtool object, so verify it.
  5574. if (${SED} -e '2q' $file | grep "^# Generated by .*$PACKAGE") >/dev/null 2>&1; then
  5575. # Read the .lo file
  5576. . $dir/$name
  5577. # Add PIC object to the list of files to remove.
  5578. if test -n "$pic_object" \
  5579. && test "$pic_object" != none; then
  5580. rmfiles="$rmfiles $dir/$pic_object"
  5581. fi
  5582. # Add non-PIC object to the list of files to remove.
  5583. if test -n "$non_pic_object" \
  5584. && test "$non_pic_object" != none; then
  5585. rmfiles="$rmfiles $dir/$non_pic_object"
  5586. fi
  5587. fi
  5588. ;;
  5589. *)
  5590. if test "$mode" = clean ; then
  5591. noexename=$name
  5592. case $file in
  5593. *.exe)
  5594. file=`$echo $file|${SED} 's,.exe$,,'`
  5595. noexename=`$echo $name|${SED} 's,.exe$,,'`
  5596. # $file with .exe has already been added to rmfiles,
  5597. # add $file without .exe
  5598. rmfiles="$rmfiles $file"
  5599. ;;
  5600. esac
  5601. # Do a test to see if this is a libtool program.
  5602. if (${SED} -e '4q' $file | grep "^# Generated by .*$PACKAGE") >/dev/null 2>&1; then
  5603. relink_command=
  5604. . $dir/$noexename
  5605. # note $name still contains .exe if it was in $file originally
  5606. # as does the version of $file that was added into $rmfiles
  5607. rmfiles="$rmfiles $objdir/$name $objdir/${name}S.${objext}"
  5608. if test "$fast_install" = yes && test -n "$relink_command"; then
  5609. rmfiles="$rmfiles $objdir/lt-$name"
  5610. fi
  5611. if test "X$noexename" != "X$name" ; then
  5612. rmfiles="$rmfiles $objdir/lt-${noexename}.c"
  5613. fi
  5614. fi
  5615. fi
  5616. ;;
  5617. esac
  5618. $show "$rm $rmfiles"
  5619. $run $rm $rmfiles || exit_status=1
  5620. done
  5621. objdir="$origobjdir"
  5622. # Try to remove the ${objdir}s in the directories where we deleted files
  5623. for dir in $rmdirs; do
  5624. if test -d "$dir"; then
  5625. $show "rmdir $dir"
  5626. $run rmdir $dir >/dev/null 2>&1
  5627. fi
  5628. done
  5629. exit $exit_status
  5630. ;;
  5631. "")
  5632. $echo "$modename: you must specify a MODE" 1>&2
  5633. $echo "$generic_help" 1>&2
  5634. exit $EXIT_FAILURE
  5635. ;;
  5636. esac
  5637. if test -z "$exec_cmd"; then
  5638. $echo "$modename: invalid operation mode \`$mode'" 1>&2
  5639. $echo "$generic_help" 1>&2
  5640. exit $EXIT_FAILURE
  5641. fi
  5642. fi # test -z "$show_help"
  5643. if test -n "$exec_cmd"; then
  5644. eval exec $exec_cmd
  5645. exit $EXIT_FAILURE
  5646. fi
  5647. # We need to display help for each of the modes.
  5648. case $mode in
  5649. "") $echo \
  5650. "Usage: $modename [OPTION]... [MODE-ARG]...
  5651. Provide generalized library-building support services.
  5652. --config show all configuration variables
  5653. --debug enable verbose shell tracing
  5654. -n, --dry-run display commands without modifying any files
  5655. --features display basic configuration information and exit
  5656. --finish same as \`--mode=finish'
  5657. --help display this help message and exit
  5658. --mode=MODE use operation mode MODE [default=inferred from MODE-ARGS]
  5659. --quiet same as \`--silent'
  5660. --silent don't print informational messages
  5661. --tag=TAG use configuration variables from tag TAG
  5662. --version print version information
  5663. MODE must be one of the following:
  5664. clean remove files from the build directory
  5665. compile compile a source file into a libtool object
  5666. execute automatically set library path, then run a program
  5667. finish complete the installation of libtool libraries
  5668. install install libraries or executables
  5669. link create a library or an executable
  5670. uninstall remove libraries from an installed directory
  5671. MODE-ARGS vary depending on the MODE. Try \`$modename --help --mode=MODE' for
  5672. a more detailed description of MODE.
  5673. Report bugs to <bug-libtool@gnu.org>."
  5674. exit $EXIT_SUCCESS
  5675. ;;
  5676. clean)
  5677. $echo \
  5678. "Usage: $modename [OPTION]... --mode=clean RM [RM-OPTION]... FILE...
  5679. Remove files from the build directory.
  5680. RM is the name of the program to use to delete files associated with each FILE
  5681. (typically \`/bin/rm'). RM-OPTIONS are options (such as \`-f') to be passed
  5682. to RM.
  5683. If FILE is a libtool library, object or program, all the files associated
  5684. with it are deleted. Otherwise, only FILE itself is deleted using RM."
  5685. ;;
  5686. compile)
  5687. $echo \
  5688. "Usage: $modename [OPTION]... --mode=compile COMPILE-COMMAND... SOURCEFILE
  5689. Compile a source file into a libtool library object.
  5690. This mode accepts the following additional options:
  5691. -o OUTPUT-FILE set the output file name to OUTPUT-FILE
  5692. -prefer-pic try to building PIC objects only
  5693. -prefer-non-pic try to building non-PIC objects only
  5694. -static always build a \`.o' file suitable for static linking
  5695. COMPILE-COMMAND is a command to be used in creating a \`standard' object file
  5696. from the given SOURCEFILE.
  5697. The output file name is determined by removing the directory component from
  5698. SOURCEFILE, then substituting the C source code suffix \`.c' with the
  5699. library object suffix, \`.lo'."
  5700. ;;
  5701. execute)
  5702. $echo \
  5703. "Usage: $modename [OPTION]... --mode=execute COMMAND [ARGS]...
  5704. Automatically set library path, then run a program.
  5705. This mode accepts the following additional options:
  5706. -dlopen FILE add the directory containing FILE to the library path
  5707. This mode sets the library path environment variable according to \`-dlopen'
  5708. flags.
  5709. If any of the ARGS are libtool executable wrappers, then they are translated
  5710. into their corresponding uninstalled binary, and any of their required library
  5711. directories are added to the library path.
  5712. Then, COMMAND is executed, with ARGS as arguments."
  5713. ;;
  5714. finish)
  5715. $echo \
  5716. "Usage: $modename [OPTION]... --mode=finish [LIBDIR]...
  5717. Complete the installation of libtool libraries.
  5718. Each LIBDIR is a directory that contains libtool libraries.
  5719. The commands that this mode executes may require superuser privileges. Use
  5720. the \`--dry-run' option if you just want to see what would be executed."
  5721. ;;
  5722. install)
  5723. $echo \
  5724. "Usage: $modename [OPTION]... --mode=install INSTALL-COMMAND...
  5725. Install executables or libraries.
  5726. INSTALL-COMMAND is the installation command. The first component should be
  5727. either the \`install' or \`cp' program.
  5728. The rest of the components are interpreted as arguments to that command (only
  5729. BSD-compatible install options are recognized)."
  5730. ;;
  5731. link)
  5732. $echo \
  5733. "Usage: $modename [OPTION]... --mode=link LINK-COMMAND...
  5734. Link object files or libraries together to form another library, or to
  5735. create an executable program.
  5736. LINK-COMMAND is a command using the C compiler that you would use to create
  5737. a program from several object files.
  5738. The following components of LINK-COMMAND are treated specially:
  5739. -all-static do not do any dynamic linking at all
  5740. -avoid-version do not add a version suffix if possible
  5741. -dlopen FILE \`-dlpreopen' FILE if it cannot be dlopened at runtime
  5742. -dlpreopen FILE link in FILE and add its symbols to lt_preloaded_symbols
  5743. -export-dynamic allow symbols from OUTPUT-FILE to be resolved with dlsym(3)
  5744. -export-symbols SYMFILE
  5745. try to export only the symbols listed in SYMFILE
  5746. -export-symbols-regex REGEX
  5747. try to export only the symbols matching REGEX
  5748. -LLIBDIR search LIBDIR for required installed libraries
  5749. -lNAME OUTPUT-FILE requires the installed library libNAME
  5750. -module build a library that can dlopened
  5751. -no-fast-install disable the fast-install mode
  5752. -no-install link a not-installable executable
  5753. -no-undefined declare that a library does not refer to external symbols
  5754. -o OUTPUT-FILE create OUTPUT-FILE from the specified objects
  5755. -objectlist FILE Use a list of object files found in FILE to specify objects
  5756. -precious-files-regex REGEX
  5757. don't remove output files matching REGEX
  5758. -release RELEASE specify package release information
  5759. -rpath LIBDIR the created library will eventually be installed in LIBDIR
  5760. -R[ ]LIBDIR add LIBDIR to the runtime path of programs and libraries
  5761. -static do not do any dynamic linking of libtool libraries
  5762. -version-info CURRENT[:REVISION[:AGE]]
  5763. specify library version info [each variable defaults to 0]
  5764. All other options (arguments beginning with \`-') are ignored.
  5765. Every other argument is treated as a filename. Files ending in \`.la' are
  5766. treated as uninstalled libtool libraries, other files are standard or library
  5767. object files.
  5768. If the OUTPUT-FILE ends in \`.la', then a libtool library is created,
  5769. only library objects (\`.lo' files) may be specified, and \`-rpath' is
  5770. required, except when creating a convenience library.
  5771. If OUTPUT-FILE ends in \`.a' or \`.lib', then a standard library is created
  5772. using \`ar' and \`ranlib', or on Windows using \`lib'.
  5773. If OUTPUT-FILE ends in \`.lo' or \`.${objext}', then a reloadable object file
  5774. is created, otherwise an executable program is created."
  5775. ;;
  5776. uninstall)
  5777. $echo \
  5778. "Usage: $modename [OPTION]... --mode=uninstall RM [RM-OPTION]... FILE...
  5779. Remove libraries from an installation directory.
  5780. RM is the name of the program to use to delete files associated with each FILE
  5781. (typically \`/bin/rm'). RM-OPTIONS are options (such as \`-f') to be passed
  5782. to RM.
  5783. If FILE is a libtool library, all the files associated with it are deleted.
  5784. Otherwise, only FILE itself is deleted using RM."
  5785. ;;
  5786. *)
  5787. $echo "$modename: invalid operation mode \`$mode'" 1>&2
  5788. $echo "$help" 1>&2
  5789. exit $EXIT_FAILURE
  5790. ;;
  5791. esac
  5792. $echo
  5793. $echo "Try \`$modename --help' for more information about other modes."
  5794. exit $?
  5795. # The TAGs below are defined such that we never get into a situation
  5796. # in which we disable both kinds of libraries. Given conflicting
  5797. # choices, we go for a static library, that is the most portable,
  5798. # since we can't tell whether shared libraries were disabled because
  5799. # the user asked for that or because the platform doesn't support
  5800. # them. This is particularly important on AIX, because we don't
  5801. # support having both static and shared libraries enabled at the same
  5802. # time on that platform, so we default to a shared-only configuration.
  5803. # If a disable-shared tag is given, we'll fallback to a static-only
  5804. # configuration. But we'll never go from static-only to shared-only.
  5805. # ### BEGIN LIBTOOL TAG CONFIG: disable-shared
  5806. build_libtool_libs=no
  5807. build_old_libs=yes
  5808. # ### END LIBTOOL TAG CONFIG: disable-shared
  5809. # ### BEGIN LIBTOOL TAG CONFIG: disable-static
  5810. build_old_libs=`case $build_libtool_libs in yes) $echo no;; *) $echo yes;; esac`
  5811. # ### END LIBTOOL TAG CONFIG: disable-static
  5812. # Local Variables:
  5813. # mode:shell-script
  5814. # sh-indentation:2
  5815. # End: