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.

6956 lines
195 KiB

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