Testing out the PPD42 Air Quality Sensor, with an MSP430 Launchpad and graphing the data with GNUplot.
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

6500 lines
188 KiB

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