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.

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