diff ltmain.sh @ 0:d39e1d0d75b6

initial add
author paulo@hit-nxdomain.opendns.com
date Sat, 20 Feb 2010 21:18:28 -0800
parents
children
line diff
     1.1 --- /dev/null	Thu Jan 01 00:00:00 1970 +0000
     1.2 +++ b/ltmain.sh	Sat Feb 20 21:18:28 2010 -0800
     1.3 @@ -0,0 +1,6871 @@
     1.4 +# ltmain.sh - Provide generalized library-building support services.
     1.5 +# NOTE: Changing this file will not affect anything until you rerun configure.
     1.6 +#
     1.7 +# Copyright (C) 1996, 1997, 1998, 1999, 2000, 2001, 2003, 2004, 2005
     1.8 +# Free Software Foundation, Inc.
     1.9 +# Originally by Gordon Matzigkeit <gord@gnu.ai.mit.edu>, 1996
    1.10 +#
    1.11 +# This program is free software; you can redistribute it and/or modify
    1.12 +# it under the terms of the GNU General Public License as published by
    1.13 +# the Free Software Foundation; either version 2 of the License, or
    1.14 +# (at your option) any later version.
    1.15 +#
    1.16 +# This program is distributed in the hope that it will be useful, but
    1.17 +# WITHOUT ANY WARRANTY; without even the implied warranty of
    1.18 +# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
    1.19 +# General Public License for more details.
    1.20 +#
    1.21 +# You should have received a copy of the GNU General Public License
    1.22 +# along with this program; if not, write to the Free Software
    1.23 +# Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
    1.24 +#
    1.25 +# As a special exception to the GNU General Public License, if you
    1.26 +# distribute this file as part of a program that contains a
    1.27 +# configuration script generated by Autoconf, you may include it under
    1.28 +# the same distribution terms that you use for the rest of that program.
    1.29 +
    1.30 +basename="s,^.*/,,g"
    1.31 +
    1.32 +# Work around backward compatibility issue on IRIX 6.5. On IRIX 6.4+, sh
    1.33 +# is ksh but when the shell is invoked as "sh" and the current value of
    1.34 +# the _XPG environment variable is not equal to 1 (one), the special
    1.35 +# positional parameter $0, within a function call, is the name of the
    1.36 +# function.
    1.37 +progpath="$0"
    1.38 +
    1.39 +# The name of this program:
    1.40 +progname=`echo "$progpath" | $SED $basename`
    1.41 +modename="$progname"
    1.42 +
    1.43 +# Global variables:
    1.44 +EXIT_SUCCESS=0
    1.45 +EXIT_FAILURE=1
    1.46 +
    1.47 +PROGRAM=ltmain.sh
    1.48 +PACKAGE=libtool
    1.49 +VERSION="1.5.22 Debian 1.5.22-2"
    1.50 +TIMESTAMP=" (1.1220.2.365 2005/12/18 22:14:06)"
    1.51 +
    1.52 +# See if we are running on zsh, and set the options which allow our
    1.53 +# commands through without removal of \ escapes.
    1.54 +if test -n "${ZSH_VERSION+set}" ; then
    1.55 +  setopt NO_GLOB_SUBST
    1.56 +fi
    1.57 +
    1.58 +# Check that we have a working $echo.
    1.59 +if test "X$1" = X--no-reexec; then
    1.60 +  # Discard the --no-reexec flag, and continue.
    1.61 +  shift
    1.62 +elif test "X$1" = X--fallback-echo; then
    1.63 +  # Avoid inline document here, it may be left over
    1.64 +  :
    1.65 +elif test "X`($echo '\t') 2>/dev/null`" = 'X\t'; then
    1.66 +  # Yippee, $echo works!
    1.67 +  :
    1.68 +else
    1.69 +  # Restart under the correct shell, and then maybe $echo will work.
    1.70 +  exec $SHELL "$progpath" --no-reexec ${1+"$@"}
    1.71 +fi
    1.72 +
    1.73 +if test "X$1" = X--fallback-echo; then
    1.74 +  # used as fallback echo
    1.75 +  shift
    1.76 +  cat <<EOF
    1.77 +$*
    1.78 +EOF
    1.79 +  exit $EXIT_SUCCESS
    1.80 +fi
    1.81 +
    1.82 +default_mode=
    1.83 +help="Try \`$progname --help' for more information."
    1.84 +magic="%%%MAGIC variable%%%"
    1.85 +mkdir="mkdir"
    1.86 +mv="mv -f"
    1.87 +rm="rm -f"
    1.88 +
    1.89 +# Sed substitution that helps us do robust quoting.  It backslashifies
    1.90 +# metacharacters that are still active within double-quoted strings.
    1.91 +Xsed="${SED}"' -e 1s/^X//'
    1.92 +sed_quote_subst='s/\([\\`\\"$\\\\]\)/\\\1/g'
    1.93 +# test EBCDIC or ASCII
    1.94 +case `echo X|tr X '\101'` in
    1.95 + A) # ASCII based system
    1.96 +    # \n is not interpreted correctly by Solaris 8 /usr/ucb/tr
    1.97 +  SP2NL='tr \040 \012'
    1.98 +  NL2SP='tr \015\012 \040\040'
    1.99 +  ;;
   1.100 + *) # EBCDIC based system
   1.101 +  SP2NL='tr \100 \n'
   1.102 +  NL2SP='tr \r\n \100\100'
   1.103 +  ;;
   1.104 +esac
   1.105 +
   1.106 +# NLS nuisances.
   1.107 +# Only set LANG and LC_ALL to C if already set.
   1.108 +# These must not be set unconditionally because not all systems understand
   1.109 +# e.g. LANG=C (notably SCO).
   1.110 +# We save the old values to restore during execute mode.
   1.111 +if test "${LC_ALL+set}" = set; then
   1.112 +  save_LC_ALL="$LC_ALL"; LC_ALL=C; export LC_ALL
   1.113 +fi
   1.114 +if test "${LANG+set}" = set; then
   1.115 +  save_LANG="$LANG"; LANG=C; export LANG
   1.116 +fi
   1.117 +
   1.118 +# Make sure IFS has a sensible default
   1.119 +lt_nl='
   1.120 +'
   1.121 +IFS=" 	$lt_nl"
   1.122 +
   1.123 +if test "$build_libtool_libs" != yes && test "$build_old_libs" != yes; then
   1.124 +  $echo "$modename: not configured to build any kind of library" 1>&2
   1.125 +  $echo "Fatal configuration error.  See the $PACKAGE docs for more information." 1>&2
   1.126 +  exit $EXIT_FAILURE
   1.127 +fi
   1.128 +
   1.129 +# Global variables.
   1.130 +mode=$default_mode
   1.131 +nonopt=
   1.132 +prev=
   1.133 +prevopt=
   1.134 +run=
   1.135 +show="$echo"
   1.136 +show_help=
   1.137 +execute_dlfiles=
   1.138 +duplicate_deps=no
   1.139 +preserve_args=
   1.140 +lo2o="s/\\.lo\$/.${objext}/"
   1.141 +o2lo="s/\\.${objext}\$/.lo/"
   1.142 +
   1.143 +#####################################
   1.144 +# Shell function definitions:
   1.145 +# This seems to be the best place for them
   1.146 +
   1.147 +# func_mktempdir [string]
   1.148 +# Make a temporary directory that won't clash with other running
   1.149 +# libtool processes, and avoids race conditions if possible.  If
   1.150 +# given, STRING is the basename for that directory.
   1.151 +func_mktempdir ()
   1.152 +{
   1.153 +    my_template="${TMPDIR-/tmp}/${1-$progname}"
   1.154 +
   1.155 +    if test "$run" = ":"; then
   1.156 +      # Return a directory name, but don't create it in dry-run mode
   1.157 +      my_tmpdir="${my_template}-$$"
   1.158 +    else
   1.159 +
   1.160 +      # If mktemp works, use that first and foremost
   1.161 +      my_tmpdir=`mktemp -d "${my_template}-XXXXXXXX" 2>/dev/null`
   1.162 +
   1.163 +      if test ! -d "$my_tmpdir"; then
   1.164 +	# Failing that, at least try and use $RANDOM to avoid a race
   1.165 +	my_tmpdir="${my_template}-${RANDOM-0}$$"
   1.166 +
   1.167 +	save_mktempdir_umask=`umask`
   1.168 +	umask 0077
   1.169 +	$mkdir "$my_tmpdir"
   1.170 +	umask $save_mktempdir_umask
   1.171 +      fi
   1.172 +
   1.173 +      # If we're not in dry-run mode, bomb out on failure
   1.174 +      test -d "$my_tmpdir" || {
   1.175 +        $echo "cannot create temporary directory \`$my_tmpdir'" 1>&2
   1.176 +	exit $EXIT_FAILURE
   1.177 +      }
   1.178 +    fi
   1.179 +
   1.180 +    $echo "X$my_tmpdir" | $Xsed
   1.181 +}
   1.182 +
   1.183 +
   1.184 +# func_win32_libid arg
   1.185 +# return the library type of file 'arg'
   1.186 +#
   1.187 +# Need a lot of goo to handle *both* DLLs and import libs
   1.188 +# Has to be a shell function in order to 'eat' the argument
   1.189 +# that is supplied when $file_magic_command is called.
   1.190 +func_win32_libid ()
   1.191 +{
   1.192 +  win32_libid_type="unknown"
   1.193 +  win32_fileres=`file -L $1 2>/dev/null`
   1.194 +  case $win32_fileres in
   1.195 +  *ar\ archive\ import\ library*) # definitely import
   1.196 +    win32_libid_type="x86 archive import"
   1.197 +    ;;
   1.198 +  *ar\ archive*) # could be an import, or static
   1.199 +    if eval $OBJDUMP -f $1 | $SED -e '10q' 2>/dev/null | \
   1.200 +      $EGREP -e 'file format pe-i386(.*architecture: i386)?' >/dev/null ; then
   1.201 +      win32_nmres=`eval $NM -f posix -A $1 | \
   1.202 +	$SED -n -e '1,100{/ I /{s,.*,import,;p;q;};}'`
   1.203 +      case $win32_nmres in
   1.204 +      import*)  win32_libid_type="x86 archive import";;
   1.205 +      *)        win32_libid_type="x86 archive static";;
   1.206 +      esac
   1.207 +    fi
   1.208 +    ;;
   1.209 +  *DLL*)
   1.210 +    win32_libid_type="x86 DLL"
   1.211 +    ;;
   1.212 +  *executable*) # but shell scripts are "executable" too...
   1.213 +    case $win32_fileres in
   1.214 +    *MS\ Windows\ PE\ Intel*)
   1.215 +      win32_libid_type="x86 DLL"
   1.216 +      ;;
   1.217 +    esac
   1.218 +    ;;
   1.219 +  esac
   1.220 +  $echo $win32_libid_type
   1.221 +}
   1.222 +
   1.223 +
   1.224 +# func_infer_tag arg
   1.225 +# Infer tagged configuration to use if any are available and
   1.226 +# if one wasn't chosen via the "--tag" command line option.
   1.227 +# Only attempt this if the compiler in the base compile
   1.228 +# command doesn't match the default compiler.
   1.229 +# arg is usually of the form 'gcc ...'
   1.230 +func_infer_tag ()
   1.231 +{
   1.232 +    if test -n "$available_tags" && test -z "$tagname"; then
   1.233 +      CC_quoted=
   1.234 +      for arg in $CC; do
   1.235 +	case $arg in
   1.236 +	  *[\[\~\#\^\&\*\(\)\{\}\|\;\<\>\?\'\ \	]*|*]*|"")
   1.237 +	  arg="\"$arg\""
   1.238 +	  ;;
   1.239 +	esac
   1.240 +	CC_quoted="$CC_quoted $arg"
   1.241 +      done
   1.242 +      case $@ in
   1.243 +      # Blanks in the command may have been stripped by the calling shell,
   1.244 +      # but not from the CC environment variable when configure was run.
   1.245 +      " $CC "* | "$CC "* | " `$echo $CC` "* | "`$echo $CC` "* | " $CC_quoted"* | "$CC_quoted "* | " `$echo $CC_quoted` "* | "`$echo $CC_quoted` "*) ;;
   1.246 +      # Blanks at the start of $base_compile will cause this to fail
   1.247 +      # if we don't check for them as well.
   1.248 +      *)
   1.249 +	for z in $available_tags; do
   1.250 +	  if grep "^# ### BEGIN LIBTOOL TAG CONFIG: $z$" < "$progpath" > /dev/null; then
   1.251 +	    # Evaluate the configuration.
   1.252 +	    eval "`${SED} -n -e '/^# ### BEGIN LIBTOOL TAG CONFIG: '$z'$/,/^# ### END LIBTOOL TAG CONFIG: '$z'$/p' < $progpath`"
   1.253 +	    CC_quoted=
   1.254 +	    for arg in $CC; do
   1.255 +	    # Double-quote args containing other shell metacharacters.
   1.256 +	    case $arg in
   1.257 +	      *[\[\~\#\^\&\*\(\)\{\}\|\;\<\>\?\'\ \	]*|*]*|"")
   1.258 +	      arg="\"$arg\""
   1.259 +	      ;;
   1.260 +	    esac
   1.261 +	    CC_quoted="$CC_quoted $arg"
   1.262 +	  done
   1.263 +	    case "$@ " in
   1.264 +	      " $CC "* | "$CC "* | " `$echo $CC` "* | "`$echo $CC` "* | " $CC_quoted"* | "$CC_quoted "* | " `$echo $CC_quoted` "* | "`$echo $CC_quoted` "*)
   1.265 +	      # The compiler in the base compile command matches
   1.266 +	      # the one in the tagged configuration.
   1.267 +	      # Assume this is the tagged configuration we want.
   1.268 +	      tagname=$z
   1.269 +	      break
   1.270 +	      ;;
   1.271 +	    esac
   1.272 +	  fi
   1.273 +	done
   1.274 +	# If $tagname still isn't set, then no tagged configuration
   1.275 +	# was found and let the user know that the "--tag" command
   1.276 +	# line option must be used.
   1.277 +	if test -z "$tagname"; then
   1.278 +	  $echo "$modename: unable to infer tagged configuration"
   1.279 +	  $echo "$modename: specify a tag with \`--tag'" 1>&2
   1.280 +	  exit $EXIT_FAILURE
   1.281 +#        else
   1.282 +#          $echo "$modename: using $tagname tagged configuration"
   1.283 +	fi
   1.284 +	;;
   1.285 +      esac
   1.286 +    fi
   1.287 +}
   1.288 +
   1.289 +
   1.290 +# func_extract_an_archive dir oldlib
   1.291 +func_extract_an_archive ()
   1.292 +{
   1.293 +    f_ex_an_ar_dir="$1"; shift
   1.294 +    f_ex_an_ar_oldlib="$1"
   1.295 +
   1.296 +    $show "(cd $f_ex_an_ar_dir && $AR x $f_ex_an_ar_oldlib)"
   1.297 +    $run eval "(cd \$f_ex_an_ar_dir && $AR x \$f_ex_an_ar_oldlib)" || exit $?
   1.298 +    if ($AR t "$f_ex_an_ar_oldlib" | sort | sort -uc >/dev/null 2>&1); then
   1.299 +     :
   1.300 +    else
   1.301 +      $echo "$modename: ERROR: object name conflicts: $f_ex_an_ar_dir/$f_ex_an_ar_oldlib" 1>&2
   1.302 +      exit $EXIT_FAILURE
   1.303 +    fi
   1.304 +}
   1.305 +
   1.306 +# func_extract_archives gentop oldlib ...
   1.307 +func_extract_archives ()
   1.308 +{
   1.309 +    my_gentop="$1"; shift
   1.310 +    my_oldlibs=${1+"$@"}
   1.311 +    my_oldobjs=""
   1.312 +    my_xlib=""
   1.313 +    my_xabs=""
   1.314 +    my_xdir=""
   1.315 +    my_status=""
   1.316 +
   1.317 +    $show "${rm}r $my_gentop"
   1.318 +    $run ${rm}r "$my_gentop"
   1.319 +    $show "$mkdir $my_gentop"
   1.320 +    $run $mkdir "$my_gentop"
   1.321 +    my_status=$?
   1.322 +    if test "$my_status" -ne 0 && test ! -d "$my_gentop"; then
   1.323 +      exit $my_status
   1.324 +    fi
   1.325 +
   1.326 +    for my_xlib in $my_oldlibs; do
   1.327 +      # Extract the objects.
   1.328 +      case $my_xlib in
   1.329 +	[\\/]* | [A-Za-z]:[\\/]*) my_xabs="$my_xlib" ;;
   1.330 +	*) my_xabs=`pwd`"/$my_xlib" ;;
   1.331 +      esac
   1.332 +      my_xlib=`$echo "X$my_xlib" | $Xsed -e 's%^.*/%%'`
   1.333 +      my_xdir="$my_gentop/$my_xlib"
   1.334 +
   1.335 +      $show "${rm}r $my_xdir"
   1.336 +      $run ${rm}r "$my_xdir"
   1.337 +      $show "$mkdir $my_xdir"
   1.338 +      $run $mkdir "$my_xdir"
   1.339 +      exit_status=$?
   1.340 +      if test "$exit_status" -ne 0 && test ! -d "$my_xdir"; then
   1.341 +	exit $exit_status
   1.342 +      fi
   1.343 +      case $host in
   1.344 +      *-darwin*)
   1.345 +	$show "Extracting $my_xabs"
   1.346 +	# Do not bother doing anything if just a dry run
   1.347 +	if test -z "$run"; then
   1.348 +	  darwin_orig_dir=`pwd`
   1.349 +	  cd $my_xdir || exit $?
   1.350 +	  darwin_archive=$my_xabs
   1.351 +	  darwin_curdir=`pwd`
   1.352 +	  darwin_base_archive=`$echo "X$darwin_archive" | $Xsed -e 's%^.*/%%'`
   1.353 +	  darwin_arches=`lipo -info "$darwin_archive" 2>/dev/null | $EGREP Architectures 2>/dev/null`
   1.354 +	  if test -n "$darwin_arches"; then 
   1.355 +	    darwin_arches=`echo "$darwin_arches" | $SED -e 's/.*are://'`
   1.356 +	    darwin_arch=
   1.357 +	    $show "$darwin_base_archive has multiple architectures $darwin_arches"
   1.358 +	    for darwin_arch in  $darwin_arches ; do
   1.359 +	      mkdir -p "unfat-$$/${darwin_base_archive}-${darwin_arch}"
   1.360 +	      lipo -thin $darwin_arch -output "unfat-$$/${darwin_base_archive}-${darwin_arch}/${darwin_base_archive}" "${darwin_archive}"
   1.361 +	      cd "unfat-$$/${darwin_base_archive}-${darwin_arch}"
   1.362 +	      func_extract_an_archive "`pwd`" "${darwin_base_archive}"
   1.363 +	      cd "$darwin_curdir"
   1.364 +	      $rm "unfat-$$/${darwin_base_archive}-${darwin_arch}/${darwin_base_archive}"
   1.365 +	    done # $darwin_arches
   1.366 +      ## Okay now we have a bunch of thin objects, gotta fatten them up :)
   1.367 +	    darwin_filelist=`find unfat-$$ -type f -name \*.o -print -o -name \*.lo -print| xargs basename | sort -u | $NL2SP`
   1.368 +	    darwin_file=
   1.369 +	    darwin_files=
   1.370 +	    for darwin_file in $darwin_filelist; do
   1.371 +	      darwin_files=`find unfat-$$ -name $darwin_file -print | $NL2SP`
   1.372 +	      lipo -create -output "$darwin_file" $darwin_files
   1.373 +	    done # $darwin_filelist
   1.374 +	    ${rm}r unfat-$$
   1.375 +	    cd "$darwin_orig_dir"
   1.376 +	  else
   1.377 +	    cd "$darwin_orig_dir"
   1.378 + 	    func_extract_an_archive "$my_xdir" "$my_xabs"
   1.379 +	  fi # $darwin_arches
   1.380 +	fi # $run
   1.381 +	;;
   1.382 +      *)
   1.383 +        func_extract_an_archive "$my_xdir" "$my_xabs"
   1.384 +        ;;
   1.385 +      esac
   1.386 +      my_oldobjs="$my_oldobjs "`find $my_xdir -name \*.$objext -print -o -name \*.lo -print | $NL2SP`
   1.387 +    done
   1.388 +    func_extract_archives_result="$my_oldobjs"
   1.389 +}
   1.390 +# End of Shell function definitions
   1.391 +#####################################
   1.392 +
   1.393 +# Darwin sucks
   1.394 +eval std_shrext=\"$shrext_cmds\"
   1.395 +
   1.396 +disable_libs=no
   1.397 +
   1.398 +# Parse our command line options once, thoroughly.
   1.399 +while test "$#" -gt 0
   1.400 +do
   1.401 +  arg="$1"
   1.402 +  shift
   1.403 +
   1.404 +  case $arg in
   1.405 +  -*=*) optarg=`$echo "X$arg" | $Xsed -e 's/[-_a-zA-Z0-9]*=//'` ;;
   1.406 +  *) optarg= ;;
   1.407 +  esac
   1.408 +
   1.409 +  # If the previous option needs an argument, assign it.
   1.410 +  if test -n "$prev"; then
   1.411 +    case $prev in
   1.412 +    execute_dlfiles)
   1.413 +      execute_dlfiles="$execute_dlfiles $arg"
   1.414 +      ;;
   1.415 +    tag)
   1.416 +      tagname="$arg"
   1.417 +      preserve_args="${preserve_args}=$arg"
   1.418 +
   1.419 +      # Check whether tagname contains only valid characters
   1.420 +      case $tagname in
   1.421 +      *[!-_A-Za-z0-9,/]*)
   1.422 +	$echo "$progname: invalid tag name: $tagname" 1>&2
   1.423 +	exit $EXIT_FAILURE
   1.424 +	;;
   1.425 +      esac
   1.426 +
   1.427 +      case $tagname in
   1.428 +      CC)
   1.429 +	# Don't test for the "default" C tag, as we know, it's there, but
   1.430 +	# not specially marked.
   1.431 +	;;
   1.432 +      *)
   1.433 +	if grep "^# ### BEGIN LIBTOOL TAG CONFIG: $tagname$" < "$progpath" > /dev/null; then
   1.434 +	  taglist="$taglist $tagname"
   1.435 +	  # Evaluate the configuration.
   1.436 +	  eval "`${SED} -n -e '/^# ### BEGIN LIBTOOL TAG CONFIG: '$tagname'$/,/^# ### END LIBTOOL TAG CONFIG: '$tagname'$/p' < $progpath`"
   1.437 +	else
   1.438 +	  $echo "$progname: ignoring unknown tag $tagname" 1>&2
   1.439 +	fi
   1.440 +	;;
   1.441 +      esac
   1.442 +      ;;
   1.443 +    *)
   1.444 +      eval "$prev=\$arg"
   1.445 +      ;;
   1.446 +    esac
   1.447 +
   1.448 +    prev=
   1.449 +    prevopt=
   1.450 +    continue
   1.451 +  fi
   1.452 +
   1.453 +  # Have we seen a non-optional argument yet?
   1.454 +  case $arg in
   1.455 +  --help)
   1.456 +    show_help=yes
   1.457 +    ;;
   1.458 +
   1.459 +  --version)
   1.460 +    $echo "$PROGRAM (GNU $PACKAGE) $VERSION$TIMESTAMP"
   1.461 +    $echo
   1.462 +    $echo "Copyright (C) 2005  Free Software Foundation, Inc."
   1.463 +    $echo "This is free software; see the source for copying conditions.  There is NO"
   1.464 +    $echo "warranty; not even for MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE."
   1.465 +    exit $?
   1.466 +    ;;
   1.467 +
   1.468 +  --config)
   1.469 +    ${SED} -e '1,/^# ### BEGIN LIBTOOL CONFIG/d' -e '/^# ### END LIBTOOL CONFIG/,$d' $progpath
   1.470 +    # Now print the configurations for the tags.
   1.471 +    for tagname in $taglist; do
   1.472 +      ${SED} -n -e "/^# ### BEGIN LIBTOOL TAG CONFIG: $tagname$/,/^# ### END LIBTOOL TAG CONFIG: $tagname$/p" < "$progpath"
   1.473 +    done
   1.474 +    exit $?
   1.475 +    ;;
   1.476 +
   1.477 +  --debug)
   1.478 +    $echo "$progname: enabling shell trace mode"
   1.479 +    set -x
   1.480 +    preserve_args="$preserve_args $arg"
   1.481 +    ;;
   1.482 +
   1.483 +  --dry-run | -n)
   1.484 +    run=:
   1.485 +    ;;
   1.486 +
   1.487 +  --features)
   1.488 +    $echo "host: $host"
   1.489 +    if test "$build_libtool_libs" = yes; then
   1.490 +      $echo "enable shared libraries"
   1.491 +    else
   1.492 +      $echo "disable shared libraries"
   1.493 +    fi
   1.494 +    if test "$build_old_libs" = yes; then
   1.495 +      $echo "enable static libraries"
   1.496 +    else
   1.497 +      $echo "disable static libraries"
   1.498 +    fi
   1.499 +    exit $?
   1.500 +    ;;
   1.501 +
   1.502 +  --finish) mode="finish" ;;
   1.503 +
   1.504 +  --mode) prevopt="--mode" prev=mode ;;
   1.505 +  --mode=*) mode="$optarg" ;;
   1.506 +
   1.507 +  --preserve-dup-deps) duplicate_deps="yes" ;;
   1.508 +
   1.509 +  --quiet | --silent)
   1.510 +    show=:
   1.511 +    preserve_args="$preserve_args $arg"
   1.512 +    ;;
   1.513 +
   1.514 +  --tag)
   1.515 +    prevopt="--tag"
   1.516 +    prev=tag
   1.517 +    preserve_args="$preserve_args --tag"
   1.518 +    ;;
   1.519 +  --tag=*)
   1.520 +    set tag "$optarg" ${1+"$@"}
   1.521 +    shift
   1.522 +    prev=tag
   1.523 +    preserve_args="$preserve_args --tag"
   1.524 +    ;;
   1.525 +
   1.526 +  -dlopen)
   1.527 +    prevopt="-dlopen"
   1.528 +    prev=execute_dlfiles
   1.529 +    ;;
   1.530 +
   1.531 +  -*)
   1.532 +    $echo "$modename: unrecognized option \`$arg'" 1>&2
   1.533 +    $echo "$help" 1>&2
   1.534 +    exit $EXIT_FAILURE
   1.535 +    ;;
   1.536 +
   1.537 +  *)
   1.538 +    nonopt="$arg"
   1.539 +    break
   1.540 +    ;;
   1.541 +  esac
   1.542 +done
   1.543 +
   1.544 +if test -n "$prevopt"; then
   1.545 +  $echo "$modename: option \`$prevopt' requires an argument" 1>&2
   1.546 +  $echo "$help" 1>&2
   1.547 +  exit $EXIT_FAILURE
   1.548 +fi
   1.549 +
   1.550 +case $disable_libs in
   1.551 +no) 
   1.552 +  ;;
   1.553 +shared)
   1.554 +  build_libtool_libs=no
   1.555 +  build_old_libs=yes
   1.556 +  ;;
   1.557 +static)
   1.558 +  build_old_libs=`case $build_libtool_libs in yes) echo no;; *) echo yes;; esac`
   1.559 +  ;;
   1.560 +esac
   1.561 +
   1.562 +# If this variable is set in any of the actions, the command in it
   1.563 +# will be execed at the end.  This prevents here-documents from being
   1.564 +# left over by shells.
   1.565 +exec_cmd=
   1.566 +
   1.567 +if test -z "$show_help"; then
   1.568 +
   1.569 +  # Infer the operation mode.
   1.570 +  if test -z "$mode"; then
   1.571 +    $echo "*** Warning: inferring the mode of operation is deprecated." 1>&2
   1.572 +    $echo "*** Future versions of Libtool will require --mode=MODE be specified." 1>&2
   1.573 +    case $nonopt in
   1.574 +    *cc | cc* | *++ | gcc* | *-gcc* | g++* | xlc*)
   1.575 +      mode=link
   1.576 +      for arg
   1.577 +      do
   1.578 +	case $arg in
   1.579 +	-c)
   1.580 +	   mode=compile
   1.581 +	   break
   1.582 +	   ;;
   1.583 +	esac
   1.584 +      done
   1.585 +      ;;
   1.586 +    *db | *dbx | *strace | *truss)
   1.587 +      mode=execute
   1.588 +      ;;
   1.589 +    *install*|cp|mv)
   1.590 +      mode=install
   1.591 +      ;;
   1.592 +    *rm)
   1.593 +      mode=uninstall
   1.594 +      ;;
   1.595 +    *)
   1.596 +      # If we have no mode, but dlfiles were specified, then do execute mode.
   1.597 +      test -n "$execute_dlfiles" && mode=execute
   1.598 +
   1.599 +      # Just use the default operation mode.
   1.600 +      if test -z "$mode"; then
   1.601 +	if test -n "$nonopt"; then
   1.602 +	  $echo "$modename: warning: cannot infer operation mode from \`$nonopt'" 1>&2
   1.603 +	else
   1.604 +	  $echo "$modename: warning: cannot infer operation mode without MODE-ARGS" 1>&2
   1.605 +	fi
   1.606 +      fi
   1.607 +      ;;
   1.608 +    esac
   1.609 +  fi
   1.610 +
   1.611 +  # Only execute mode is allowed to have -dlopen flags.
   1.612 +  if test -n "$execute_dlfiles" && test "$mode" != execute; then
   1.613 +    $echo "$modename: unrecognized option \`-dlopen'" 1>&2
   1.614 +    $echo "$help" 1>&2
   1.615 +    exit $EXIT_FAILURE
   1.616 +  fi
   1.617 +
   1.618 +  # Change the help message to a mode-specific one.
   1.619 +  generic_help="$help"
   1.620 +  help="Try \`$modename --help --mode=$mode' for more information."
   1.621 +
   1.622 +  # These modes are in order of execution frequency so that they run quickly.
   1.623 +  case $mode in
   1.624 +  # libtool compile mode
   1.625 +  compile)
   1.626 +    modename="$modename: compile"
   1.627 +    # Get the compilation command and the source file.
   1.628 +    base_compile=
   1.629 +    srcfile="$nonopt"  #  always keep a non-empty value in "srcfile"
   1.630 +    suppress_opt=yes
   1.631 +    suppress_output=
   1.632 +    arg_mode=normal
   1.633 +    libobj=
   1.634 +    later=
   1.635 +
   1.636 +    for arg
   1.637 +    do
   1.638 +      case $arg_mode in
   1.639 +      arg  )
   1.640 +	# do not "continue".  Instead, add this to base_compile
   1.641 +	lastarg="$arg"
   1.642 +	arg_mode=normal
   1.643 +	;;
   1.644 +
   1.645 +      target )
   1.646 +	libobj="$arg"
   1.647 +	arg_mode=normal
   1.648 +	continue
   1.649 +	;;
   1.650 +
   1.651 +      normal )
   1.652 +	# Accept any command-line options.
   1.653 +	case $arg in
   1.654 +	-o)
   1.655 +	  if test -n "$libobj" ; then
   1.656 +	    $echo "$modename: you cannot specify \`-o' more than once" 1>&2
   1.657 +	    exit $EXIT_FAILURE
   1.658 +	  fi
   1.659 +	  arg_mode=target
   1.660 +	  continue
   1.661 +	  ;;
   1.662 +
   1.663 +	-static | -prefer-pic | -prefer-non-pic)
   1.664 +	  later="$later $arg"
   1.665 +	  continue
   1.666 +	  ;;
   1.667 +
   1.668 +	-no-suppress)
   1.669 +	  suppress_opt=no
   1.670 +	  continue
   1.671 +	  ;;
   1.672 +
   1.673 +	-Xcompiler)
   1.674 +	  arg_mode=arg  #  the next one goes into the "base_compile" arg list
   1.675 +	  continue      #  The current "srcfile" will either be retained or
   1.676 +	  ;;            #  replaced later.  I would guess that would be a bug.
   1.677 +
   1.678 +	-Wc,*)
   1.679 +	  args=`$echo "X$arg" | $Xsed -e "s/^-Wc,//"`
   1.680 +	  lastarg=
   1.681 +	  save_ifs="$IFS"; IFS=','
   1.682 + 	  for arg in $args; do
   1.683 +	    IFS="$save_ifs"
   1.684 +
   1.685 +	    # Double-quote args containing other shell metacharacters.
   1.686 +	    # Many Bourne shells cannot handle close brackets correctly
   1.687 +	    # in scan sets, so we specify it separately.
   1.688 +	    case $arg in
   1.689 +	      *[\[\~\#\^\&\*\(\)\{\}\|\;\<\>\?\'\ \	]*|*]*|"")
   1.690 +	      arg="\"$arg\""
   1.691 +	      ;;
   1.692 +	    esac
   1.693 +	    lastarg="$lastarg $arg"
   1.694 +	  done
   1.695 +	  IFS="$save_ifs"
   1.696 +	  lastarg=`$echo "X$lastarg" | $Xsed -e "s/^ //"`
   1.697 +
   1.698 +	  # Add the arguments to base_compile.
   1.699 +	  base_compile="$base_compile $lastarg"
   1.700 +	  continue
   1.701 +	  ;;
   1.702 +
   1.703 +	* )
   1.704 +	  # Accept the current argument as the source file.
   1.705 +	  # The previous "srcfile" becomes the current argument.
   1.706 +	  #
   1.707 +	  lastarg="$srcfile"
   1.708 +	  srcfile="$arg"
   1.709 +	  ;;
   1.710 +	esac  #  case $arg
   1.711 +	;;
   1.712 +      esac    #  case $arg_mode
   1.713 +
   1.714 +      # Aesthetically quote the previous argument.
   1.715 +      lastarg=`$echo "X$lastarg" | $Xsed -e "$sed_quote_subst"`
   1.716 +
   1.717 +      case $lastarg in
   1.718 +      # Double-quote args containing other shell metacharacters.
   1.719 +      # Many Bourne shells cannot handle close brackets correctly
   1.720 +      # in scan sets, and some SunOS ksh mistreat backslash-escaping
   1.721 +      # in scan sets (worked around with variable expansion),
   1.722 +      # and furthermore cannot handle '|' '&' '(' ')' in scan sets 
   1.723 +      # at all, so we specify them separately.
   1.724 +      *[\[\~\#\^\&\*\(\)\{\}\|\;\<\>\?\'\ \	]*|*]*|"")
   1.725 +	lastarg="\"$lastarg\""
   1.726 +	;;
   1.727 +      esac
   1.728 +
   1.729 +      base_compile="$base_compile $lastarg"
   1.730 +    done # for arg
   1.731 +
   1.732 +    case $arg_mode in
   1.733 +    arg)
   1.734 +      $echo "$modename: you must specify an argument for -Xcompile"
   1.735 +      exit $EXIT_FAILURE
   1.736 +      ;;
   1.737 +    target)
   1.738 +      $echo "$modename: you must specify a target with \`-o'" 1>&2
   1.739 +      exit $EXIT_FAILURE
   1.740 +      ;;
   1.741 +    *)
   1.742 +      # Get the name of the library object.
   1.743 +      [ -z "$libobj" ] && libobj=`$echo "X$srcfile" | $Xsed -e 's%^.*/%%'`
   1.744 +      ;;
   1.745 +    esac
   1.746 +
   1.747 +    # Recognize several different file suffixes.
   1.748 +    # If the user specifies -o file.o, it is replaced with file.lo
   1.749 +    xform='[cCFSifmso]'
   1.750 +    case $libobj in
   1.751 +    *.ada) xform=ada ;;
   1.752 +    *.adb) xform=adb ;;
   1.753 +    *.ads) xform=ads ;;
   1.754 +    *.asm) xform=asm ;;
   1.755 +    *.c++) xform=c++ ;;
   1.756 +    *.cc) xform=cc ;;
   1.757 +    *.ii) xform=ii ;;
   1.758 +    *.class) xform=class ;;
   1.759 +    *.cpp) xform=cpp ;;
   1.760 +    *.cxx) xform=cxx ;;
   1.761 +    *.f90) xform=f90 ;;
   1.762 +    *.for) xform=for ;;
   1.763 +    *.java) xform=java ;;
   1.764 +    esac
   1.765 +
   1.766 +    libobj=`$echo "X$libobj" | $Xsed -e "s/\.$xform$/.lo/"`
   1.767 +
   1.768 +    case $libobj in
   1.769 +    *.lo) obj=`$echo "X$libobj" | $Xsed -e "$lo2o"` ;;
   1.770 +    *)
   1.771 +      $echo "$modename: cannot determine name of library object from \`$libobj'" 1>&2
   1.772 +      exit $EXIT_FAILURE
   1.773 +      ;;
   1.774 +    esac
   1.775 +
   1.776 +    func_infer_tag $base_compile
   1.777 +
   1.778 +    for arg in $later; do
   1.779 +      case $arg in
   1.780 +      -static)
   1.781 +	build_old_libs=yes
   1.782 +	continue
   1.783 +	;;
   1.784 +
   1.785 +      -prefer-pic)
   1.786 +	pic_mode=yes
   1.787 +	continue
   1.788 +	;;
   1.789 +
   1.790 +      -prefer-non-pic)
   1.791 +	pic_mode=no
   1.792 +	continue
   1.793 +	;;
   1.794 +      esac
   1.795 +    done
   1.796 +
   1.797 +    qlibobj=`$echo "X$libobj" | $Xsed -e "$sed_quote_subst"`
   1.798 +    case $qlibobj in
   1.799 +      *[\[\~\#\^\&\*\(\)\{\}\|\;\<\>\?\'\ \	]*|*]*|"")
   1.800 +	qlibobj="\"$qlibobj\"" ;;
   1.801 +    esac
   1.802 +    test "X$libobj" != "X$qlibobj" \
   1.803 +	&& $echo "X$libobj" | grep '[]~#^*{};<>?"'"'"' 	&()|`$[]' \
   1.804 +	&& $echo "$modename: libobj name \`$libobj' may not contain shell special characters."
   1.805 +    objname=`$echo "X$obj" | $Xsed -e 's%^.*/%%'`
   1.806 +    xdir=`$echo "X$obj" | $Xsed -e 's%/[^/]*$%%'`
   1.807 +    if test "X$xdir" = "X$obj"; then
   1.808 +      xdir=
   1.809 +    else
   1.810 +      xdir=$xdir/
   1.811 +    fi
   1.812 +    lobj=${xdir}$objdir/$objname
   1.813 +
   1.814 +    if test -z "$base_compile"; then
   1.815 +      $echo "$modename: you must specify a compilation command" 1>&2
   1.816 +      $echo "$help" 1>&2
   1.817 +      exit $EXIT_FAILURE
   1.818 +    fi
   1.819 +
   1.820 +    # Delete any leftover library objects.
   1.821 +    if test "$build_old_libs" = yes; then
   1.822 +      removelist="$obj $lobj $libobj ${libobj}T"
   1.823 +    else
   1.824 +      removelist="$lobj $libobj ${libobj}T"
   1.825 +    fi
   1.826 +
   1.827 +    $run $rm $removelist
   1.828 +    trap "$run $rm $removelist; exit $EXIT_FAILURE" 1 2 15
   1.829 +
   1.830 +    # On Cygwin there's no "real" PIC flag so we must build both object types
   1.831 +    case $host_os in
   1.832 +    cygwin* | mingw* | pw32* | os2*)
   1.833 +      pic_mode=default
   1.834 +      ;;
   1.835 +    esac
   1.836 +    if test "$pic_mode" = no && test "$deplibs_check_method" != pass_all; then
   1.837 +      # non-PIC code in shared libraries is not supported
   1.838 +      pic_mode=default
   1.839 +    fi
   1.840 +
   1.841 +    # Calculate the filename of the output object if compiler does
   1.842 +    # not support -o with -c
   1.843 +    if test "$compiler_c_o" = no; then
   1.844 +      output_obj=`$echo "X$srcfile" | $Xsed -e 's%^.*/%%' -e 's%\.[^.]*$%%'`.${objext}
   1.845 +      lockfile="$output_obj.lock"
   1.846 +      removelist="$removelist $output_obj $lockfile"
   1.847 +      trap "$run $rm $removelist; exit $EXIT_FAILURE" 1 2 15
   1.848 +    else
   1.849 +      output_obj=
   1.850 +      need_locks=no
   1.851 +      lockfile=
   1.852 +    fi
   1.853 +
   1.854 +    # Lock this critical section if it is needed
   1.855 +    # We use this script file to make the link, it avoids creating a new file
   1.856 +    if test "$need_locks" = yes; then
   1.857 +      until $run ln "$progpath" "$lockfile" 2>/dev/null; do
   1.858 +	$show "Waiting for $lockfile to be removed"
   1.859 +	sleep 2
   1.860 +      done
   1.861 +    elif test "$need_locks" = warn; then
   1.862 +      if test -f "$lockfile"; then
   1.863 +	$echo "\
   1.864 +*** ERROR, $lockfile exists and contains:
   1.865 +`cat $lockfile 2>/dev/null`
   1.866 +
   1.867 +This indicates that another process is trying to use the same
   1.868 +temporary object file, and libtool could not work around it because
   1.869 +your compiler does not support \`-c' and \`-o' together.  If you
   1.870 +repeat this compilation, it may succeed, by chance, but you had better
   1.871 +avoid parallel builds (make -j) in this platform, or get a better
   1.872 +compiler."
   1.873 +
   1.874 +	$run $rm $removelist
   1.875 +	exit $EXIT_FAILURE
   1.876 +      fi
   1.877 +      $echo "$srcfile" > "$lockfile"
   1.878 +    fi
   1.879 +
   1.880 +    if test -n "$fix_srcfile_path"; then
   1.881 +      eval srcfile=\"$fix_srcfile_path\"
   1.882 +    fi
   1.883 +    qsrcfile=`$echo "X$srcfile" | $Xsed -e "$sed_quote_subst"`
   1.884 +    case $qsrcfile in
   1.885 +      *[\[\~\#\^\&\*\(\)\{\}\|\;\<\>\?\'\ \	]*|*]*|"")
   1.886 +      qsrcfile="\"$qsrcfile\"" ;;
   1.887 +    esac
   1.888 +
   1.889 +    $run $rm "$libobj" "${libobj}T"
   1.890 +
   1.891 +    # Create a libtool object file (analogous to a ".la" file),
   1.892 +    # but don't create it if we're doing a dry run.
   1.893 +    test -z "$run" && cat > ${libobj}T <<EOF
   1.894 +# $libobj - a libtool object file
   1.895 +# Generated by $PROGRAM - GNU $PACKAGE $VERSION$TIMESTAMP
   1.896 +#
   1.897 +# Please DO NOT delete this file!
   1.898 +# It is necessary for linking the library.
   1.899 +
   1.900 +# Name of the PIC object.
   1.901 +EOF
   1.902 +
   1.903 +    # Only build a PIC object if we are building libtool libraries.
   1.904 +    if test "$build_libtool_libs" = yes; then
   1.905 +      # Without this assignment, base_compile gets emptied.
   1.906 +      fbsd_hideous_sh_bug=$base_compile
   1.907 +
   1.908 +      if test "$pic_mode" != no; then
   1.909 +	command="$base_compile $qsrcfile $pic_flag"
   1.910 +      else
   1.911 +	# Don't build PIC code
   1.912 +	command="$base_compile $qsrcfile"
   1.913 +      fi
   1.914 +
   1.915 +      if test ! -d "${xdir}$objdir"; then
   1.916 +	$show "$mkdir ${xdir}$objdir"
   1.917 +	$run $mkdir ${xdir}$objdir
   1.918 +	exit_status=$?
   1.919 +	if test "$exit_status" -ne 0 && test ! -d "${xdir}$objdir"; then
   1.920 +	  exit $exit_status
   1.921 +	fi
   1.922 +      fi
   1.923 +
   1.924 +      if test -z "$output_obj"; then
   1.925 +	# Place PIC objects in $objdir
   1.926 +	command="$command -o $lobj"
   1.927 +      fi
   1.928 +
   1.929 +      $run $rm "$lobj" "$output_obj"
   1.930 +
   1.931 +      $show "$command"
   1.932 +      if $run eval "$command"; then :
   1.933 +      else
   1.934 +	test -n "$output_obj" && $run $rm $removelist
   1.935 +	exit $EXIT_FAILURE
   1.936 +      fi
   1.937 +
   1.938 +      if test "$need_locks" = warn &&
   1.939 +	 test "X`cat $lockfile 2>/dev/null`" != "X$srcfile"; then
   1.940 +	$echo "\
   1.941 +*** ERROR, $lockfile contains:
   1.942 +`cat $lockfile 2>/dev/null`
   1.943 +
   1.944 +but it should contain:
   1.945 +$srcfile
   1.946 +
   1.947 +This indicates that another process is trying to use the same
   1.948 +temporary object file, and libtool could not work around it because
   1.949 +your compiler does not support \`-c' and \`-o' together.  If you
   1.950 +repeat this compilation, it may succeed, by chance, but you had better
   1.951 +avoid parallel builds (make -j) in this platform, or get a better
   1.952 +compiler."
   1.953 +
   1.954 +	$run $rm $removelist
   1.955 +	exit $EXIT_FAILURE
   1.956 +      fi
   1.957 +
   1.958 +      # Just move the object if needed, then go on to compile the next one
   1.959 +      if test -n "$output_obj" && test "X$output_obj" != "X$lobj"; then
   1.960 +	$show "$mv $output_obj $lobj"
   1.961 +	if $run $mv $output_obj $lobj; then :
   1.962 +	else
   1.963 +	  error=$?
   1.964 +	  $run $rm $removelist
   1.965 +	  exit $error
   1.966 +	fi
   1.967 +      fi
   1.968 +
   1.969 +      # Append the name of the PIC object to the libtool object file.
   1.970 +      test -z "$run" && cat >> ${libobj}T <<EOF
   1.971 +pic_object='$objdir/$objname'
   1.972 +
   1.973 +EOF
   1.974 +
   1.975 +      # Allow error messages only from the first compilation.
   1.976 +      if test "$suppress_opt" = yes; then
   1.977 +        suppress_output=' >/dev/null 2>&1'
   1.978 +      fi
   1.979 +    else
   1.980 +      # No PIC object so indicate it doesn't exist in the libtool
   1.981 +      # object file.
   1.982 +      test -z "$run" && cat >> ${libobj}T <<EOF
   1.983 +pic_object=none
   1.984 +
   1.985 +EOF
   1.986 +    fi
   1.987 +
   1.988 +    # Only build a position-dependent object if we build old libraries.
   1.989 +    if test "$build_old_libs" = yes; then
   1.990 +      if test "$pic_mode" != yes; then
   1.991 +	# Don't build PIC code
   1.992 +	command="$base_compile $qsrcfile"
   1.993 +      else
   1.994 +	command="$base_compile $qsrcfile $pic_flag"
   1.995 +      fi
   1.996 +      if test "$compiler_c_o" = yes; then
   1.997 +	command="$command -o $obj"
   1.998 +      fi
   1.999 +
  1.1000 +      # Suppress compiler output if we already did a PIC compilation.
  1.1001 +      command="$command$suppress_output"
  1.1002 +      $run $rm "$obj" "$output_obj"
  1.1003 +      $show "$command"
  1.1004 +      if $run eval "$command"; then :
  1.1005 +      else
  1.1006 +	$run $rm $removelist
  1.1007 +	exit $EXIT_FAILURE
  1.1008 +      fi
  1.1009 +
  1.1010 +      if test "$need_locks" = warn &&
  1.1011 +	 test "X`cat $lockfile 2>/dev/null`" != "X$srcfile"; then
  1.1012 +	$echo "\
  1.1013 +*** ERROR, $lockfile contains:
  1.1014 +`cat $lockfile 2>/dev/null`
  1.1015 +
  1.1016 +but it should contain:
  1.1017 +$srcfile
  1.1018 +
  1.1019 +This indicates that another process is trying to use the same
  1.1020 +temporary object file, and libtool could not work around it because
  1.1021 +your compiler does not support \`-c' and \`-o' together.  If you
  1.1022 +repeat this compilation, it may succeed, by chance, but you had better
  1.1023 +avoid parallel builds (make -j) in this platform, or get a better
  1.1024 +compiler."
  1.1025 +
  1.1026 +	$run $rm $removelist
  1.1027 +	exit $EXIT_FAILURE
  1.1028 +      fi
  1.1029 +
  1.1030 +      # Just move the object if needed
  1.1031 +      if test -n "$output_obj" && test "X$output_obj" != "X$obj"; then
  1.1032 +	$show "$mv $output_obj $obj"
  1.1033 +	if $run $mv $output_obj $obj; then :
  1.1034 +	else
  1.1035 +	  error=$?
  1.1036 +	  $run $rm $removelist
  1.1037 +	  exit $error
  1.1038 +	fi
  1.1039 +      fi
  1.1040 +
  1.1041 +      # Append the name of the non-PIC object the libtool object file.
  1.1042 +      # Only append if the libtool object file exists.
  1.1043 +      test -z "$run" && cat >> ${libobj}T <<EOF
  1.1044 +# Name of the non-PIC object.
  1.1045 +non_pic_object='$objname'
  1.1046 +
  1.1047 +EOF
  1.1048 +    else
  1.1049 +      # Append the name of the non-PIC object the libtool object file.
  1.1050 +      # Only append if the libtool object file exists.
  1.1051 +      test -z "$run" && cat >> ${libobj}T <<EOF
  1.1052 +# Name of the non-PIC object.
  1.1053 +non_pic_object=none
  1.1054 +
  1.1055 +EOF
  1.1056 +    fi
  1.1057 +
  1.1058 +    $run $mv "${libobj}T" "${libobj}"
  1.1059 +
  1.1060 +    # Unlock the critical section if it was locked
  1.1061 +    if test "$need_locks" != no; then
  1.1062 +      $run $rm "$lockfile"
  1.1063 +    fi
  1.1064 +
  1.1065 +    exit $EXIT_SUCCESS
  1.1066 +    ;;
  1.1067 +
  1.1068 +  # libtool link mode
  1.1069 +  link | relink)
  1.1070 +    modename="$modename: link"
  1.1071 +    case $host in
  1.1072 +    *-*-cygwin* | *-*-mingw* | *-*-pw32* | *-*-os2*)
  1.1073 +      # It is impossible to link a dll without this setting, and
  1.1074 +      # we shouldn't force the makefile maintainer to figure out
  1.1075 +      # which system we are compiling for in order to pass an extra
  1.1076 +      # flag for every libtool invocation.
  1.1077 +      # allow_undefined=no
  1.1078 +
  1.1079 +      # FIXME: Unfortunately, there are problems with the above when trying
  1.1080 +      # to make a dll which has undefined symbols, in which case not
  1.1081 +      # even a static library is built.  For now, we need to specify
  1.1082 +      # -no-undefined on the libtool link line when we can be certain
  1.1083 +      # that all symbols are satisfied, otherwise we get a static library.
  1.1084 +      allow_undefined=yes
  1.1085 +      ;;
  1.1086 +    *)
  1.1087 +      allow_undefined=yes
  1.1088 +      ;;
  1.1089 +    esac
  1.1090 +    libtool_args="$nonopt"
  1.1091 +    base_compile="$nonopt $@"
  1.1092 +    compile_command="$nonopt"
  1.1093 +    finalize_command="$nonopt"
  1.1094 +
  1.1095 +    compile_rpath=
  1.1096 +    finalize_rpath=
  1.1097 +    compile_shlibpath=
  1.1098 +    finalize_shlibpath=
  1.1099 +    convenience=
  1.1100 +    old_convenience=
  1.1101 +    deplibs=
  1.1102 +    old_deplibs=
  1.1103 +    compiler_flags=
  1.1104 +    linker_flags=
  1.1105 +    dllsearchpath=
  1.1106 +    lib_search_path=`pwd`
  1.1107 +    inst_prefix_dir=
  1.1108 +
  1.1109 +    avoid_version=no
  1.1110 +    dlfiles=
  1.1111 +    dlprefiles=
  1.1112 +    dlself=no
  1.1113 +    export_dynamic=no
  1.1114 +    export_symbols=
  1.1115 +    export_symbols_regex=
  1.1116 +    generated=
  1.1117 +    libobjs=
  1.1118 +    ltlibs=
  1.1119 +    module=no
  1.1120 +    no_install=no
  1.1121 +    objs=
  1.1122 +    non_pic_objects=
  1.1123 +    notinst_path= # paths that contain not-installed libtool libraries
  1.1124 +    precious_files_regex=
  1.1125 +    prefer_static_libs=no
  1.1126 +    preload=no
  1.1127 +    prev=
  1.1128 +    prevarg=
  1.1129 +    release=
  1.1130 +    rpath=
  1.1131 +    xrpath=
  1.1132 +    perm_rpath=
  1.1133 +    temp_rpath=
  1.1134 +    thread_safe=no
  1.1135 +    vinfo=
  1.1136 +    vinfo_number=no
  1.1137 +
  1.1138 +    func_infer_tag $base_compile
  1.1139 +
  1.1140 +    # We need to know -static, to get the right output filenames.
  1.1141 +    for arg
  1.1142 +    do
  1.1143 +      case $arg in
  1.1144 +      -all-static | -static)
  1.1145 +	if test "X$arg" = "X-all-static"; then
  1.1146 +	  if test "$build_libtool_libs" = yes && test -z "$link_static_flag"; then
  1.1147 +	    $echo "$modename: warning: complete static linking is impossible in this configuration" 1>&2
  1.1148 +	  fi
  1.1149 +	  if test -n "$link_static_flag"; then
  1.1150 +	    dlopen_self=$dlopen_self_static
  1.1151 +	  fi
  1.1152 +	  prefer_static_libs=yes
  1.1153 +	else
  1.1154 +	  if test -z "$pic_flag" && test -n "$link_static_flag"; then
  1.1155 +	    dlopen_self=$dlopen_self_static
  1.1156 +	  fi
  1.1157 +	  prefer_static_libs=built
  1.1158 +	fi
  1.1159 +	build_libtool_libs=no
  1.1160 +	build_old_libs=yes
  1.1161 +	break
  1.1162 +	;;
  1.1163 +      esac
  1.1164 +    done
  1.1165 +
  1.1166 +    # See if our shared archives depend on static archives.
  1.1167 +    test -n "$old_archive_from_new_cmds" && build_old_libs=yes
  1.1168 +
  1.1169 +    # Go through the arguments, transforming them on the way.
  1.1170 +    while test "$#" -gt 0; do
  1.1171 +      arg="$1"
  1.1172 +      shift
  1.1173 +      case $arg in
  1.1174 +      *[\[\~\#\^\&\*\(\)\{\}\|\;\<\>\?\'\ \	]*|*]*|"")
  1.1175 +	qarg=\"`$echo "X$arg" | $Xsed -e "$sed_quote_subst"`\" ### testsuite: skip nested quoting test
  1.1176 +	;;
  1.1177 +      *) qarg=$arg ;;
  1.1178 +      esac
  1.1179 +      libtool_args="$libtool_args $qarg"
  1.1180 +
  1.1181 +      # If the previous option needs an argument, assign it.
  1.1182 +      if test -n "$prev"; then
  1.1183 +	case $prev in
  1.1184 +	output)
  1.1185 +	  compile_command="$compile_command @OUTPUT@"
  1.1186 +	  finalize_command="$finalize_command @OUTPUT@"
  1.1187 +	  ;;
  1.1188 +	esac
  1.1189 +
  1.1190 +	case $prev in
  1.1191 +	dlfiles|dlprefiles)
  1.1192 +	  if test "$preload" = no; then
  1.1193 +	    # Add the symbol object into the linking commands.
  1.1194 +	    compile_command="$compile_command @SYMFILE@"
  1.1195 +	    finalize_command="$finalize_command @SYMFILE@"
  1.1196 +	    preload=yes
  1.1197 +	  fi
  1.1198 +	  case $arg in
  1.1199 +	  *.la | *.lo) ;;  # We handle these cases below.
  1.1200 +	  force)
  1.1201 +	    if test "$dlself" = no; then
  1.1202 +	      dlself=needless
  1.1203 +	      export_dynamic=yes
  1.1204 +	    fi
  1.1205 +	    prev=
  1.1206 +	    continue
  1.1207 +	    ;;
  1.1208 +	  self)
  1.1209 +	    if test "$prev" = dlprefiles; then
  1.1210 +	      dlself=yes
  1.1211 +	    elif test "$prev" = dlfiles && test "$dlopen_self" != yes; then
  1.1212 +	      dlself=yes
  1.1213 +	    else
  1.1214 +	      dlself=needless
  1.1215 +	      export_dynamic=yes
  1.1216 +	    fi
  1.1217 +	    prev=
  1.1218 +	    continue
  1.1219 +	    ;;
  1.1220 +	  *)
  1.1221 +	    if test "$prev" = dlfiles; then
  1.1222 +	      dlfiles="$dlfiles $arg"
  1.1223 +	    else
  1.1224 +	      dlprefiles="$dlprefiles $arg"
  1.1225 +	    fi
  1.1226 +	    prev=
  1.1227 +	    continue
  1.1228 +	    ;;
  1.1229 +	  esac
  1.1230 +	  ;;
  1.1231 +	expsyms)
  1.1232 +	  export_symbols="$arg"
  1.1233 +	  if test ! -f "$arg"; then
  1.1234 +	    $echo "$modename: symbol file \`$arg' does not exist"
  1.1235 +	    exit $EXIT_FAILURE
  1.1236 +	  fi
  1.1237 +	  prev=
  1.1238 +	  continue
  1.1239 +	  ;;
  1.1240 +	expsyms_regex)
  1.1241 +	  export_symbols_regex="$arg"
  1.1242 +	  prev=
  1.1243 +	  continue
  1.1244 +	  ;;
  1.1245 +	inst_prefix)
  1.1246 +	  inst_prefix_dir="$arg"
  1.1247 +	  prev=
  1.1248 +	  continue
  1.1249 +	  ;;
  1.1250 +	precious_regex)
  1.1251 +	  precious_files_regex="$arg"
  1.1252 +	  prev=
  1.1253 +	  continue
  1.1254 +	  ;;
  1.1255 +	release)
  1.1256 +	  release="-$arg"
  1.1257 +	  prev=
  1.1258 +	  continue
  1.1259 +	  ;;
  1.1260 +	objectlist)
  1.1261 +	  if test -f "$arg"; then
  1.1262 +	    save_arg=$arg
  1.1263 +	    moreargs=
  1.1264 +	    for fil in `cat $save_arg`
  1.1265 +	    do
  1.1266 +#	      moreargs="$moreargs $fil"
  1.1267 +	      arg=$fil
  1.1268 +	      # A libtool-controlled object.
  1.1269 +
  1.1270 +	      # Check to see that this really is a libtool object.
  1.1271 +	      if (${SED} -e '2q' $arg | grep "^# Generated by .*$PACKAGE") >/dev/null 2>&1; then
  1.1272 +		pic_object=
  1.1273 +		non_pic_object=
  1.1274 +
  1.1275 +		# Read the .lo file
  1.1276 +		# If there is no directory component, then add one.
  1.1277 +		case $arg in
  1.1278 +		*/* | *\\*) . $arg ;;
  1.1279 +		*) . ./$arg ;;
  1.1280 +		esac
  1.1281 +
  1.1282 +		if test -z "$pic_object" || \
  1.1283 +		   test -z "$non_pic_object" ||
  1.1284 +		   test "$pic_object" = none && \
  1.1285 +		   test "$non_pic_object" = none; then
  1.1286 +		  $echo "$modename: cannot find name of object for \`$arg'" 1>&2
  1.1287 +		  exit $EXIT_FAILURE
  1.1288 +		fi
  1.1289 +
  1.1290 +		# Extract subdirectory from the argument.
  1.1291 +		xdir=`$echo "X$arg" | $Xsed -e 's%/[^/]*$%%'`
  1.1292 +		if test "X$xdir" = "X$arg"; then
  1.1293 +		  xdir=
  1.1294 +		else
  1.1295 +		  xdir="$xdir/"
  1.1296 +		fi
  1.1297 +
  1.1298 +		if test "$pic_object" != none; then
  1.1299 +		  # Prepend the subdirectory the object is found in.
  1.1300 +		  pic_object="$xdir$pic_object"
  1.1301 +
  1.1302 +		  if test "$prev" = dlfiles; then
  1.1303 +		    if test "$build_libtool_libs" = yes && test "$dlopen_support" = yes; then
  1.1304 +		      dlfiles="$dlfiles $pic_object"
  1.1305 +		      prev=
  1.1306 +		      continue
  1.1307 +		    else
  1.1308 +		      # If libtool objects are unsupported, then we need to preload.
  1.1309 +		      prev=dlprefiles
  1.1310 +		    fi
  1.1311 +		  fi
  1.1312 +
  1.1313 +		  # CHECK ME:  I think I busted this.  -Ossama
  1.1314 +		  if test "$prev" = dlprefiles; then
  1.1315 +		    # Preload the old-style object.
  1.1316 +		    dlprefiles="$dlprefiles $pic_object"
  1.1317 +		    prev=
  1.1318 +		  fi
  1.1319 +
  1.1320 +		  # A PIC object.
  1.1321 +		  libobjs="$libobjs $pic_object"
  1.1322 +		  arg="$pic_object"
  1.1323 +		fi
  1.1324 +
  1.1325 +		# Non-PIC object.
  1.1326 +		if test "$non_pic_object" != none; then
  1.1327 +		  # Prepend the subdirectory the object is found in.
  1.1328 +		  non_pic_object="$xdir$non_pic_object"
  1.1329 +
  1.1330 +		  # A standard non-PIC object
  1.1331 +		  non_pic_objects="$non_pic_objects $non_pic_object"
  1.1332 +		  if test -z "$pic_object" || test "$pic_object" = none ; then
  1.1333 +		    arg="$non_pic_object"
  1.1334 +		  fi
  1.1335 +		else
  1.1336 +		  # If the PIC object exists, use it instead.
  1.1337 +		  # $xdir was prepended to $pic_object above.
  1.1338 +		  non_pic_object="$pic_object"
  1.1339 +		  non_pic_objects="$non_pic_objects $non_pic_object"
  1.1340 +		fi
  1.1341 +	      else
  1.1342 +		# Only an error if not doing a dry-run.
  1.1343 +		if test -z "$run"; then
  1.1344 +		  $echo "$modename: \`$arg' is not a valid libtool object" 1>&2
  1.1345 +		  exit $EXIT_FAILURE
  1.1346 +		else
  1.1347 +		  # Dry-run case.
  1.1348 +
  1.1349 +		  # Extract subdirectory from the argument.
  1.1350 +		  xdir=`$echo "X$arg" | $Xsed -e 's%/[^/]*$%%'`
  1.1351 +		  if test "X$xdir" = "X$arg"; then
  1.1352 +		    xdir=
  1.1353 +		  else
  1.1354 +		    xdir="$xdir/"
  1.1355 +		  fi
  1.1356 +
  1.1357 +		  pic_object=`$echo "X${xdir}${objdir}/${arg}" | $Xsed -e "$lo2o"`
  1.1358 +		  non_pic_object=`$echo "X${xdir}${arg}" | $Xsed -e "$lo2o"`
  1.1359 +		  libobjs="$libobjs $pic_object"
  1.1360 +		  non_pic_objects="$non_pic_objects $non_pic_object"
  1.1361 +		fi
  1.1362 +	      fi
  1.1363 +	    done
  1.1364 +	  else
  1.1365 +	    $echo "$modename: link input file \`$save_arg' does not exist"
  1.1366 +	    exit $EXIT_FAILURE
  1.1367 +	  fi
  1.1368 +	  arg=$save_arg
  1.1369 +	  prev=
  1.1370 +	  continue
  1.1371 +	  ;;
  1.1372 +	rpath | xrpath)
  1.1373 +	  # We need an absolute path.
  1.1374 +	  case $arg in
  1.1375 +	  [\\/]* | [A-Za-z]:[\\/]*) ;;
  1.1376 +	  *)
  1.1377 +	    $echo "$modename: only absolute run-paths are allowed" 1>&2
  1.1378 +	    exit $EXIT_FAILURE
  1.1379 +	    ;;
  1.1380 +	  esac
  1.1381 +	  if test "$prev" = rpath; then
  1.1382 +	    case "$rpath " in
  1.1383 +	    *" $arg "*) ;;
  1.1384 +	    *) rpath="$rpath $arg" ;;
  1.1385 +	    esac
  1.1386 +	  else
  1.1387 +	    case "$xrpath " in
  1.1388 +	    *" $arg "*) ;;
  1.1389 +	    *) xrpath="$xrpath $arg" ;;
  1.1390 +	    esac
  1.1391 +	  fi
  1.1392 +	  prev=
  1.1393 +	  continue
  1.1394 +	  ;;
  1.1395 +	xcompiler)
  1.1396 +	  compiler_flags="$compiler_flags $qarg"
  1.1397 +	  prev=
  1.1398 +	  compile_command="$compile_command $qarg"
  1.1399 +	  finalize_command="$finalize_command $qarg"
  1.1400 +	  continue
  1.1401 +	  ;;
  1.1402 +	xlinker)
  1.1403 +	  linker_flags="$linker_flags $qarg"
  1.1404 +	  compiler_flags="$compiler_flags $wl$qarg"
  1.1405 +	  prev=
  1.1406 +	  compile_command="$compile_command $wl$qarg"
  1.1407 +	  finalize_command="$finalize_command $wl$qarg"
  1.1408 +	  continue
  1.1409 +	  ;;
  1.1410 +	xcclinker)
  1.1411 +	  linker_flags="$linker_flags $qarg"
  1.1412 +	  compiler_flags="$compiler_flags $qarg"
  1.1413 +	  prev=
  1.1414 +	  compile_command="$compile_command $qarg"
  1.1415 +	  finalize_command="$finalize_command $qarg"
  1.1416 +	  continue
  1.1417 +	  ;;
  1.1418 +	shrext)
  1.1419 +  	  shrext_cmds="$arg"
  1.1420 +	  prev=
  1.1421 +	  continue
  1.1422 +	  ;;
  1.1423 +	darwin_framework|darwin_framework_skip)
  1.1424 +	  test "$prev" = "darwin_framework" && compiler_flags="$compiler_flags $arg"
  1.1425 +	  compile_command="$compile_command $arg"
  1.1426 +	  finalize_command="$finalize_command $arg"
  1.1427 +	  prev=
  1.1428 +	  continue
  1.1429 +	  ;;
  1.1430 +	*)
  1.1431 +	  eval "$prev=\"\$arg\""
  1.1432 +	  prev=
  1.1433 +	  continue
  1.1434 +	  ;;
  1.1435 +	esac
  1.1436 +      fi # test -n "$prev"
  1.1437 +
  1.1438 +      prevarg="$arg"
  1.1439 +
  1.1440 +      case $arg in
  1.1441 +      -all-static)
  1.1442 +	if test -n "$link_static_flag"; then
  1.1443 +	  compile_command="$compile_command $link_static_flag"
  1.1444 +	  finalize_command="$finalize_command $link_static_flag"
  1.1445 +	fi
  1.1446 +	continue
  1.1447 +	;;
  1.1448 +
  1.1449 +      -allow-undefined)
  1.1450 +	# FIXME: remove this flag sometime in the future.
  1.1451 +	$echo "$modename: \`-allow-undefined' is deprecated because it is the default" 1>&2
  1.1452 +	continue
  1.1453 +	;;
  1.1454 +
  1.1455 +      -avoid-version)
  1.1456 +	avoid_version=yes
  1.1457 +	continue
  1.1458 +	;;
  1.1459 +
  1.1460 +      -dlopen)
  1.1461 +	prev=dlfiles
  1.1462 +	continue
  1.1463 +	;;
  1.1464 +
  1.1465 +      -dlpreopen)
  1.1466 +	prev=dlprefiles
  1.1467 +	continue
  1.1468 +	;;
  1.1469 +
  1.1470 +      -export-dynamic)
  1.1471 +	export_dynamic=yes
  1.1472 +	continue
  1.1473 +	;;
  1.1474 +
  1.1475 +      -export-symbols | -export-symbols-regex)
  1.1476 +	if test -n "$export_symbols" || test -n "$export_symbols_regex"; then
  1.1477 +	  $echo "$modename: more than one -exported-symbols argument is not allowed"
  1.1478 +	  exit $EXIT_FAILURE
  1.1479 +	fi
  1.1480 +	if test "X$arg" = "X-export-symbols"; then
  1.1481 +	  prev=expsyms
  1.1482 +	else
  1.1483 +	  prev=expsyms_regex
  1.1484 +	fi
  1.1485 +	continue
  1.1486 +	;;
  1.1487 +
  1.1488 +      -framework|-arch|-isysroot)
  1.1489 +	case " $CC " in
  1.1490 +	  *" ${arg} ${1} "* | *" ${arg}	${1} "*) 
  1.1491 +		prev=darwin_framework_skip ;;
  1.1492 +	  *) compiler_flags="$compiler_flags $arg"
  1.1493 +	     prev=darwin_framework ;;
  1.1494 +	esac
  1.1495 +	compile_command="$compile_command $arg"
  1.1496 +	finalize_command="$finalize_command $arg"
  1.1497 +	continue
  1.1498 +	;;
  1.1499 +
  1.1500 +      -inst-prefix-dir)
  1.1501 +	prev=inst_prefix
  1.1502 +	continue
  1.1503 +	;;
  1.1504 +
  1.1505 +      # The native IRIX linker understands -LANG:*, -LIST:* and -LNO:*
  1.1506 +      # so, if we see these flags be careful not to treat them like -L
  1.1507 +      -L[A-Z][A-Z]*:*)
  1.1508 +	case $with_gcc/$host in
  1.1509 +	no/*-*-irix* | /*-*-irix*)
  1.1510 +	  compile_command="$compile_command $arg"
  1.1511 +	  finalize_command="$finalize_command $arg"
  1.1512 +	  ;;
  1.1513 +	esac
  1.1514 +	continue
  1.1515 +	;;
  1.1516 +
  1.1517 +      -L*)
  1.1518 +	dir=`$echo "X$arg" | $Xsed -e 's/^-L//'`
  1.1519 +	# We need an absolute path.
  1.1520 +	case $dir in
  1.1521 +	[\\/]* | [A-Za-z]:[\\/]*) ;;
  1.1522 +	*)
  1.1523 +	  absdir=`cd "$dir" && pwd`
  1.1524 +	  if test -z "$absdir"; then
  1.1525 +	    $echo "$modename: cannot determine absolute directory name of \`$dir'" 1>&2
  1.1526 +	    absdir="$dir"
  1.1527 +	    notinst_path="$notinst_path $dir"
  1.1528 +	  fi
  1.1529 +	  dir="$absdir"
  1.1530 +	  ;;
  1.1531 +	esac
  1.1532 +	case "$deplibs " in
  1.1533 +	*" -L$dir "*) ;;
  1.1534 +	*)
  1.1535 +	  deplibs="$deplibs -L$dir"
  1.1536 +	  lib_search_path="$lib_search_path $dir"
  1.1537 +	  ;;
  1.1538 +	esac
  1.1539 +	case $host in
  1.1540 +	*-*-cygwin* | *-*-mingw* | *-*-pw32* | *-*-os2*)
  1.1541 +	  testbindir=`$echo "X$dir" | $Xsed -e 's*/lib$*/bin*'`
  1.1542 +	  case :$dllsearchpath: in
  1.1543 +	  *":$dir:"*) ;;
  1.1544 +	  *) dllsearchpath="$dllsearchpath:$dir";;
  1.1545 +	  esac
  1.1546 +	  case :$dllsearchpath: in
  1.1547 +	  *":$testbindir:"*) ;;
  1.1548 +	  *) dllsearchpath="$dllsearchpath:$testbindir";;
  1.1549 +	  esac
  1.1550 +	  ;;
  1.1551 +	esac
  1.1552 +	continue
  1.1553 +	;;
  1.1554 +
  1.1555 +      -l*)
  1.1556 +	if test "X$arg" = "X-lc" || test "X$arg" = "X-lm"; then
  1.1557 +	  case $host in
  1.1558 +	  *-*-cygwin* | *-*-mingw* | *-*-pw32* | *-*-beos*)
  1.1559 +	    # These systems don't actually have a C or math library (as such)
  1.1560 +	    continue
  1.1561 +	    ;;
  1.1562 +	  *-*-os2*)
  1.1563 +	    # These systems don't actually have a C library (as such)
  1.1564 +	    test "X$arg" = "X-lc" && continue
  1.1565 +	    ;;
  1.1566 +	  *-*-openbsd* | *-*-freebsd* | *-*-dragonfly*)
  1.1567 +	    # Do not include libc due to us having libc/libc_r.
  1.1568 +	    test "X$arg" = "X-lc" && continue
  1.1569 +	    ;;
  1.1570 +	  *-*-rhapsody* | *-*-darwin1.[012])
  1.1571 +	    # Rhapsody C and math libraries are in the System framework
  1.1572 +	    deplibs="$deplibs -framework System"
  1.1573 +	    continue
  1.1574 +	    ;;
  1.1575 +	  *-*-sco3.2v5* | *-*-sco5v6*)
  1.1576 +	    # Causes problems with __ctype
  1.1577 +	    test "X$arg" = "X-lc" && continue
  1.1578 +	    ;;
  1.1579 +	  *-*-sysv4.2uw2* | *-*-sysv5* | *-*-unixware* | *-*-OpenUNIX*)
  1.1580 +	    # Compiler inserts libc in the correct place for threads to work
  1.1581 +	    test "X$arg" = "X-lc" && continue
  1.1582 +	    ;;
  1.1583 +	  esac
  1.1584 +	elif test "X$arg" = "X-lc_r"; then
  1.1585 +	 case $host in
  1.1586 +	 *-*-openbsd* | *-*-freebsd* | *-*-dragonfly*)
  1.1587 +	   # Do not include libc_r directly, use -pthread flag.
  1.1588 +	   continue
  1.1589 +	   ;;
  1.1590 +	 esac
  1.1591 +	fi
  1.1592 +	deplibs="$deplibs $arg"
  1.1593 +	continue
  1.1594 +	;;
  1.1595 +
  1.1596 +      # Tru64 UNIX uses -model [arg] to determine the layout of C++
  1.1597 +      # classes, name mangling, and exception handling.
  1.1598 +      -model)
  1.1599 +	compile_command="$compile_command $arg"
  1.1600 +	compiler_flags="$compiler_flags $arg"
  1.1601 +	finalize_command="$finalize_command $arg"
  1.1602 +	prev=xcompiler
  1.1603 +	continue
  1.1604 +	;;
  1.1605 +
  1.1606 +     -mt|-mthreads|-kthread|-Kthread|-pthread|-pthreads|--thread-safe)
  1.1607 +	compiler_flags="$compiler_flags $arg"
  1.1608 +	compile_command="$compile_command $arg"
  1.1609 +	finalize_command="$finalize_command $arg"
  1.1610 +	continue
  1.1611 +	;;
  1.1612 +
  1.1613 +      -module)
  1.1614 +	module=yes
  1.1615 +	continue
  1.1616 +	;;
  1.1617 +
  1.1618 +      # -64, -mips[0-9] enable 64-bit mode on the SGI compiler
  1.1619 +      # -r[0-9][0-9]* specifies the processor on the SGI compiler
  1.1620 +      # -xarch=*, -xtarget=* enable 64-bit mode on the Sun compiler
  1.1621 +      # +DA*, +DD* enable 64-bit mode on the HP compiler
  1.1622 +      # -q* pass through compiler args for the IBM compiler
  1.1623 +      # -m* pass through architecture-specific compiler args for GCC
  1.1624 +      # -m*, -t[45]*, -txscale* pass through architecture-specific
  1.1625 +      # compiler args for GCC
  1.1626 +      # -pg pass through profiling flag for GCC
  1.1627 +      # @file GCC response files
  1.1628 +      -64|-mips[0-9]|-r[0-9][0-9]*|-xarch=*|-xtarget=*|+DA*|+DD*|-q*|-m*|-pg| \
  1.1629 +      -t[45]*|-txscale*|@*)
  1.1630 +
  1.1631 +	# Unknown arguments in both finalize_command and compile_command need
  1.1632 +	# to be aesthetically quoted because they are evaled later.
  1.1633 +	arg=`$echo "X$arg" | $Xsed -e "$sed_quote_subst"`
  1.1634 +	case $arg in
  1.1635 +	*[\[\~\#\^\&\*\(\)\{\}\|\;\<\>\?\'\ \	]*|*]*|"")
  1.1636 +	  arg="\"$arg\""
  1.1637 +	  ;;
  1.1638 +	esac
  1.1639 +        compile_command="$compile_command $arg"
  1.1640 +        finalize_command="$finalize_command $arg"
  1.1641 +        compiler_flags="$compiler_flags $arg"
  1.1642 +        continue
  1.1643 +        ;;
  1.1644 +
  1.1645 +      -shrext)
  1.1646 +	prev=shrext
  1.1647 +	continue
  1.1648 +	;;
  1.1649 +
  1.1650 +      -no-fast-install)
  1.1651 +	fast_install=no
  1.1652 +	continue
  1.1653 +	;;
  1.1654 +
  1.1655 +      -no-install)
  1.1656 +	case $host in
  1.1657 +	*-*-cygwin* | *-*-mingw* | *-*-pw32* | *-*-os2*)
  1.1658 +	  # The PATH hackery in wrapper scripts is required on Windows
  1.1659 +	  # in order for the loader to find any dlls it needs.
  1.1660 +	  $echo "$modename: warning: \`-no-install' is ignored for $host" 1>&2
  1.1661 +	  $echo "$modename: warning: assuming \`-no-fast-install' instead" 1>&2
  1.1662 +	  fast_install=no
  1.1663 +	  ;;
  1.1664 +	*) no_install=yes ;;
  1.1665 +	esac
  1.1666 +	continue
  1.1667 +	;;
  1.1668 +
  1.1669 +      -no-undefined)
  1.1670 +	allow_undefined=no
  1.1671 +	continue
  1.1672 +	;;
  1.1673 +
  1.1674 +      -objectlist)
  1.1675 +	prev=objectlist
  1.1676 +	continue
  1.1677 +	;;
  1.1678 +
  1.1679 +      -o) prev=output ;;
  1.1680 +
  1.1681 +      -precious-files-regex)
  1.1682 +	prev=precious_regex
  1.1683 +	continue
  1.1684 +	;;
  1.1685 +
  1.1686 +      -release)
  1.1687 +	prev=release
  1.1688 +	continue
  1.1689 +	;;
  1.1690 +
  1.1691 +      -rpath)
  1.1692 +	prev=rpath
  1.1693 +	continue
  1.1694 +	;;
  1.1695 +
  1.1696 +      -R)
  1.1697 +	prev=xrpath
  1.1698 +	continue
  1.1699 +	;;
  1.1700 +
  1.1701 +      -R*)
  1.1702 +	dir=`$echo "X$arg" | $Xsed -e 's/^-R//'`
  1.1703 +	# We need an absolute path.
  1.1704 +	case $dir in
  1.1705 +	[\\/]* | [A-Za-z]:[\\/]*) ;;
  1.1706 +	*)
  1.1707 +	  $echo "$modename: only absolute run-paths are allowed" 1>&2
  1.1708 +	  exit $EXIT_FAILURE
  1.1709 +	  ;;
  1.1710 +	esac
  1.1711 +	case "$xrpath " in
  1.1712 +	*" $dir "*) ;;
  1.1713 +	*) xrpath="$xrpath $dir" ;;
  1.1714 +	esac
  1.1715 +	continue
  1.1716 +	;;
  1.1717 +
  1.1718 +      -static)
  1.1719 +	# The effects of -static are defined in a previous loop.
  1.1720 +	# We used to do the same as -all-static on platforms that
  1.1721 +	# didn't have a PIC flag, but the assumption that the effects
  1.1722 +	# would be equivalent was wrong.  It would break on at least
  1.1723 +	# Digital Unix and AIX.
  1.1724 +	continue
  1.1725 +	;;
  1.1726 +
  1.1727 +      -thread-safe)
  1.1728 +	thread_safe=yes
  1.1729 +	continue
  1.1730 +	;;
  1.1731 +
  1.1732 +      -version-info)
  1.1733 +	prev=vinfo
  1.1734 +	continue
  1.1735 +	;;
  1.1736 +      -version-number)
  1.1737 +	prev=vinfo
  1.1738 +	vinfo_number=yes
  1.1739 +	continue
  1.1740 +	;;
  1.1741 +
  1.1742 +      -Wc,*)
  1.1743 +	args=`$echo "X$arg" | $Xsed -e "$sed_quote_subst" -e 's/^-Wc,//'`
  1.1744 +	arg=
  1.1745 +	save_ifs="$IFS"; IFS=','
  1.1746 +	for flag in $args; do
  1.1747 +	  IFS="$save_ifs"
  1.1748 +	  case $flag in
  1.1749 +	    *[\[\~\#\^\&\*\(\)\{\}\|\;\<\>\?\'\ \	]*|*]*|"")
  1.1750 +	    flag="\"$flag\""
  1.1751 +	    ;;
  1.1752 +	  esac
  1.1753 +	  arg="$arg $wl$flag"
  1.1754 +	  compiler_flags="$compiler_flags $flag"
  1.1755 +	done
  1.1756 +	IFS="$save_ifs"
  1.1757 +	arg=`$echo "X$arg" | $Xsed -e "s/^ //"`
  1.1758 +	;;
  1.1759 +
  1.1760 +      -Wl,*)
  1.1761 +	args=`$echo "X$arg" | $Xsed -e "$sed_quote_subst" -e 's/^-Wl,//'`
  1.1762 +	arg=
  1.1763 +	save_ifs="$IFS"; IFS=','
  1.1764 +	for flag in $args; do
  1.1765 +	  IFS="$save_ifs"
  1.1766 +	  case $flag in
  1.1767 +	    *[\[\~\#\^\&\*\(\)\{\}\|\;\<\>\?\'\ \	]*|*]*|"")
  1.1768 +	    flag="\"$flag\""
  1.1769 +	    ;;
  1.1770 +	  esac
  1.1771 +	  arg="$arg $wl$flag"
  1.1772 +	  compiler_flags="$compiler_flags $wl$flag"
  1.1773 +	  linker_flags="$linker_flags $flag"
  1.1774 +	done
  1.1775 +	IFS="$save_ifs"
  1.1776 +	arg=`$echo "X$arg" | $Xsed -e "s/^ //"`
  1.1777 +	;;
  1.1778 +
  1.1779 +      -Xcompiler)
  1.1780 +	prev=xcompiler
  1.1781 +	continue
  1.1782 +	;;
  1.1783 +
  1.1784 +      -Xlinker)
  1.1785 +	prev=xlinker
  1.1786 +	continue
  1.1787 +	;;
  1.1788 +
  1.1789 +      -XCClinker)
  1.1790 +	prev=xcclinker
  1.1791 +	continue
  1.1792 +	;;
  1.1793 +
  1.1794 +      # Some other compiler flag.
  1.1795 +      -* | +*)
  1.1796 +	# Unknown arguments in both finalize_command and compile_command need
  1.1797 +	# to be aesthetically quoted because they are evaled later.
  1.1798 +	arg=`$echo "X$arg" | $Xsed -e "$sed_quote_subst"`
  1.1799 +	case $arg in
  1.1800 +	*[\[\~\#\^\&\*\(\)\{\}\|\;\<\>\?\'\ \	]*|*]*|"")
  1.1801 +	  arg="\"$arg\""
  1.1802 +	  ;;
  1.1803 +	esac
  1.1804 +	;;
  1.1805 +
  1.1806 +      *.$objext)
  1.1807 +	# A standard object.
  1.1808 +	objs="$objs $arg"
  1.1809 +	;;
  1.1810 +
  1.1811 +      *.lo)
  1.1812 +	# A libtool-controlled object.
  1.1813 +
  1.1814 +	# Check to see that this really is a libtool object.
  1.1815 +	if (${SED} -e '2q' $arg | grep "^# Generated by .*$PACKAGE") >/dev/null 2>&1; then
  1.1816 +	  pic_object=
  1.1817 +	  non_pic_object=
  1.1818 +
  1.1819 +	  # Read the .lo file
  1.1820 +	  # If there is no directory component, then add one.
  1.1821 +	  case $arg in
  1.1822 +	  */* | *\\*) . $arg ;;
  1.1823 +	  *) . ./$arg ;;
  1.1824 +	  esac
  1.1825 +
  1.1826 +	  if test -z "$pic_object" || \
  1.1827 +	     test -z "$non_pic_object" ||
  1.1828 +	     test "$pic_object" = none && \
  1.1829 +	     test "$non_pic_object" = none; then
  1.1830 +	    $echo "$modename: cannot find name of object for \`$arg'" 1>&2
  1.1831 +	    exit $EXIT_FAILURE
  1.1832 +	  fi
  1.1833 +
  1.1834 +	  # Extract subdirectory from the argument.
  1.1835 +	  xdir=`$echo "X$arg" | $Xsed -e 's%/[^/]*$%%'`
  1.1836 +	  if test "X$xdir" = "X$arg"; then
  1.1837 +	    xdir=
  1.1838 + 	  else
  1.1839 +	    xdir="$xdir/"
  1.1840 +	  fi
  1.1841 +
  1.1842 +	  if test "$pic_object" != none; then
  1.1843 +	    # Prepend the subdirectory the object is found in.
  1.1844 +	    pic_object="$xdir$pic_object"
  1.1845 +
  1.1846 +	    if test "$prev" = dlfiles; then
  1.1847 +	      if test "$build_libtool_libs" = yes && test "$dlopen_support" = yes; then
  1.1848 +		dlfiles="$dlfiles $pic_object"
  1.1849 +		prev=
  1.1850 +		continue
  1.1851 +	      else
  1.1852 +		# If libtool objects are unsupported, then we need to preload.
  1.1853 +		prev=dlprefiles
  1.1854 +	      fi
  1.1855 +	    fi
  1.1856 +
  1.1857 +	    # CHECK ME:  I think I busted this.  -Ossama
  1.1858 +	    if test "$prev" = dlprefiles; then
  1.1859 +	      # Preload the old-style object.
  1.1860 +	      dlprefiles="$dlprefiles $pic_object"
  1.1861 +	      prev=
  1.1862 +	    fi
  1.1863 +
  1.1864 +	    # A PIC object.
  1.1865 +	    libobjs="$libobjs $pic_object"
  1.1866 +	    arg="$pic_object"
  1.1867 +	  fi
  1.1868 +
  1.1869 +	  # Non-PIC object.
  1.1870 +	  if test "$non_pic_object" != none; then
  1.1871 +	    # Prepend the subdirectory the object is found in.
  1.1872 +	    non_pic_object="$xdir$non_pic_object"
  1.1873 +
  1.1874 +	    # A standard non-PIC object
  1.1875 +	    non_pic_objects="$non_pic_objects $non_pic_object"
  1.1876 +	    if test -z "$pic_object" || test "$pic_object" = none ; then
  1.1877 +	      arg="$non_pic_object"
  1.1878 +	    fi
  1.1879 +	  else
  1.1880 +	    # If the PIC object exists, use it instead.
  1.1881 +	    # $xdir was prepended to $pic_object above.
  1.1882 +	    non_pic_object="$pic_object"
  1.1883 +	    non_pic_objects="$non_pic_objects $non_pic_object"
  1.1884 +	  fi
  1.1885 +	else
  1.1886 +	  # Only an error if not doing a dry-run.
  1.1887 +	  if test -z "$run"; then
  1.1888 +	    $echo "$modename: \`$arg' is not a valid libtool object" 1>&2
  1.1889 +	    exit $EXIT_FAILURE
  1.1890 +	  else
  1.1891 +	    # Dry-run case.
  1.1892 +
  1.1893 +	    # Extract subdirectory from the argument.
  1.1894 +	    xdir=`$echo "X$arg" | $Xsed -e 's%/[^/]*$%%'`
  1.1895 +	    if test "X$xdir" = "X$arg"; then
  1.1896 +	      xdir=
  1.1897 +	    else
  1.1898 +	      xdir="$xdir/"
  1.1899 +	    fi
  1.1900 +
  1.1901 +	    pic_object=`$echo "X${xdir}${objdir}/${arg}" | $Xsed -e "$lo2o"`
  1.1902 +	    non_pic_object=`$echo "X${xdir}${arg}" | $Xsed -e "$lo2o"`
  1.1903 +	    libobjs="$libobjs $pic_object"
  1.1904 +	    non_pic_objects="$non_pic_objects $non_pic_object"
  1.1905 +	  fi
  1.1906 +	fi
  1.1907 +	;;
  1.1908 +
  1.1909 +      *.$libext)
  1.1910 +	# An archive.
  1.1911 +	deplibs="$deplibs $arg"
  1.1912 +	old_deplibs="$old_deplibs $arg"
  1.1913 +	continue
  1.1914 +	;;
  1.1915 +
  1.1916 +      *.la)
  1.1917 +	# A libtool-controlled library.
  1.1918 +
  1.1919 +	if test "$prev" = dlfiles; then
  1.1920 +	  # This library was specified with -dlopen.
  1.1921 +	  dlfiles="$dlfiles $arg"
  1.1922 +	  prev=
  1.1923 +	elif test "$prev" = dlprefiles; then
  1.1924 +	  # The library was specified with -dlpreopen.
  1.1925 +	  dlprefiles="$dlprefiles $arg"
  1.1926 +	  prev=
  1.1927 +	else
  1.1928 +	  deplibs="$deplibs $arg"
  1.1929 +	fi
  1.1930 +	continue
  1.1931 +	;;
  1.1932 +
  1.1933 +      # Some other compiler argument.
  1.1934 +      *)
  1.1935 +	# Unknown arguments in both finalize_command and compile_command need
  1.1936 +	# to be aesthetically quoted because they are evaled later.
  1.1937 +	arg=`$echo "X$arg" | $Xsed -e "$sed_quote_subst"`
  1.1938 +	case $arg in
  1.1939 +	*[\[\~\#\^\&\*\(\)\{\}\|\;\<\>\?\'\ \	]*|*]*|"")
  1.1940 +	  arg="\"$arg\""
  1.1941 +	  ;;
  1.1942 +	esac
  1.1943 +	;;
  1.1944 +      esac # arg
  1.1945 +
  1.1946 +      # Now actually substitute the argument into the commands.
  1.1947 +      if test -n "$arg"; then
  1.1948 +	compile_command="$compile_command $arg"
  1.1949 +	finalize_command="$finalize_command $arg"
  1.1950 +      fi
  1.1951 +    done # argument parsing loop
  1.1952 +
  1.1953 +    if test -n "$prev"; then
  1.1954 +      $echo "$modename: the \`$prevarg' option requires an argument" 1>&2
  1.1955 +      $echo "$help" 1>&2
  1.1956 +      exit $EXIT_FAILURE
  1.1957 +    fi
  1.1958 +
  1.1959 +    if test "$export_dynamic" = yes && test -n "$export_dynamic_flag_spec"; then
  1.1960 +      eval arg=\"$export_dynamic_flag_spec\"
  1.1961 +      compile_command="$compile_command $arg"
  1.1962 +      finalize_command="$finalize_command $arg"
  1.1963 +    fi
  1.1964 +
  1.1965 +    oldlibs=
  1.1966 +    # calculate the name of the file, without its directory
  1.1967 +    outputname=`$echo "X$output" | $Xsed -e 's%^.*/%%'`
  1.1968 +    libobjs_save="$libobjs"
  1.1969 +
  1.1970 +    if test -n "$shlibpath_var"; then
  1.1971 +      # get the directories listed in $shlibpath_var
  1.1972 +      eval shlib_search_path=\`\$echo \"X\${$shlibpath_var}\" \| \$Xsed -e \'s/:/ /g\'\`
  1.1973 +    else
  1.1974 +      shlib_search_path=
  1.1975 +    fi
  1.1976 +    eval sys_lib_search_path=\"$sys_lib_search_path_spec\"
  1.1977 +    eval sys_lib_dlsearch_path=\"$sys_lib_dlsearch_path_spec\"
  1.1978 +
  1.1979 +    output_objdir=`$echo "X$output" | $Xsed -e 's%/[^/]*$%%'`
  1.1980 +    if test "X$output_objdir" = "X$output"; then
  1.1981 +      output_objdir="$objdir"
  1.1982 +    else
  1.1983 +      output_objdir="$output_objdir/$objdir"
  1.1984 +    fi
  1.1985 +    # Create the object directory.
  1.1986 +    if test ! -d "$output_objdir"; then
  1.1987 +      $show "$mkdir $output_objdir"
  1.1988 +      $run $mkdir $output_objdir
  1.1989 +      exit_status=$?
  1.1990 +      if test "$exit_status" -ne 0 && test ! -d "$output_objdir"; then
  1.1991 +	exit $exit_status
  1.1992 +      fi
  1.1993 +    fi
  1.1994 +
  1.1995 +    # Determine the type of output
  1.1996 +    case $output in
  1.1997 +    "")
  1.1998 +      $echo "$modename: you must specify an output file" 1>&2
  1.1999 +      $echo "$help" 1>&2
  1.2000 +      exit $EXIT_FAILURE
  1.2001 +      ;;
  1.2002 +    *.$libext) linkmode=oldlib ;;
  1.2003 +    *.lo | *.$objext) linkmode=obj ;;
  1.2004 +    *.la) linkmode=lib ;;
  1.2005 +    *) linkmode=prog ;; # Anything else should be a program.
  1.2006 +    esac
  1.2007 +
  1.2008 +    case $host in
  1.2009 +    *cygwin* | *mingw* | *pw32*)
  1.2010 +      # don't eliminate duplications in $postdeps and $predeps
  1.2011 +      duplicate_compiler_generated_deps=yes
  1.2012 +      ;;
  1.2013 +    *)
  1.2014 +      duplicate_compiler_generated_deps=$duplicate_deps
  1.2015 +      ;;
  1.2016 +    esac
  1.2017 +    specialdeplibs=
  1.2018 +
  1.2019 +    libs=
  1.2020 +    # Find all interdependent deplibs by searching for libraries
  1.2021 +    # that are linked more than once (e.g. -la -lb -la)
  1.2022 +    for deplib in $deplibs; do
  1.2023 +      if test "X$duplicate_deps" = "Xyes" ; then
  1.2024 +	case "$libs " in
  1.2025 +	*" $deplib "*) specialdeplibs="$specialdeplibs $deplib" ;;
  1.2026 +	esac
  1.2027 +      fi
  1.2028 +      libs="$libs $deplib"
  1.2029 +    done
  1.2030 +
  1.2031 +    if test "$linkmode" = lib; then
  1.2032 +      libs="$predeps $libs $compiler_lib_search_path $postdeps"
  1.2033 +
  1.2034 +      # Compute libraries that are listed more than once in $predeps
  1.2035 +      # $postdeps and mark them as special (i.e., whose duplicates are
  1.2036 +      # not to be eliminated).
  1.2037 +      pre_post_deps=
  1.2038 +      if test "X$duplicate_compiler_generated_deps" = "Xyes" ; then
  1.2039 +	for pre_post_dep in $predeps $postdeps; do
  1.2040 +	  case "$pre_post_deps " in
  1.2041 +	  *" $pre_post_dep "*) specialdeplibs="$specialdeplibs $pre_post_deps" ;;
  1.2042 +	  esac
  1.2043 +	  pre_post_deps="$pre_post_deps $pre_post_dep"
  1.2044 +	done
  1.2045 +      fi
  1.2046 +      pre_post_deps=
  1.2047 +    fi
  1.2048 +
  1.2049 +    deplibs=
  1.2050 +    newdependency_libs=
  1.2051 +    newlib_search_path=
  1.2052 +    need_relink=no # whether we're linking any uninstalled libtool libraries
  1.2053 +    notinst_deplibs= # not-installed libtool libraries
  1.2054 +    case $linkmode in
  1.2055 +    lib)
  1.2056 +	passes="conv link"
  1.2057 +	for file in $dlfiles $dlprefiles; do
  1.2058 +	  case $file in
  1.2059 +	  *.la) ;;
  1.2060 +	  *)
  1.2061 +	    $echo "$modename: libraries can \`-dlopen' only libtool libraries: $file" 1>&2
  1.2062 +	    exit $EXIT_FAILURE
  1.2063 +	    ;;
  1.2064 +	  esac
  1.2065 +	done
  1.2066 +	;;
  1.2067 +    prog)
  1.2068 +	compile_deplibs=
  1.2069 +	finalize_deplibs=
  1.2070 +	alldeplibs=no
  1.2071 +	newdlfiles=
  1.2072 +	newdlprefiles=
  1.2073 +	passes="conv scan dlopen dlpreopen link"
  1.2074 +	;;
  1.2075 +    *)  passes="conv"
  1.2076 +	;;
  1.2077 +    esac
  1.2078 +    for pass in $passes; do
  1.2079 +      if test "$linkmode,$pass" = "lib,link" ||
  1.2080 +	 test "$linkmode,$pass" = "prog,scan"; then
  1.2081 +	libs="$deplibs"
  1.2082 +	deplibs=
  1.2083 +      fi
  1.2084 +      if test "$linkmode" = prog; then
  1.2085 +	case $pass in
  1.2086 +	dlopen) libs="$dlfiles" ;;
  1.2087 +	dlpreopen) libs="$dlprefiles" ;;
  1.2088 +	link)
  1.2089 +	  libs="$deplibs %DEPLIBS%"
  1.2090 +	  test "X$link_all_deplibs" != Xno && libs="$libs $dependency_libs"
  1.2091 +	  ;;
  1.2092 +	esac
  1.2093 +      fi
  1.2094 +      if test "$pass" = dlopen; then
  1.2095 +	# Collect dlpreopened libraries
  1.2096 +	save_deplibs="$deplibs"
  1.2097 +	deplibs=
  1.2098 +      fi
  1.2099 +      for deplib in $libs; do
  1.2100 +	lib=
  1.2101 +	found=no
  1.2102 +	case $deplib in
  1.2103 +	-mt|-mthreads|-kthread|-Kthread|-pthread|-pthreads|--thread-safe)
  1.2104 +	  if test "$linkmode,$pass" = "prog,link"; then
  1.2105 +	    compile_deplibs="$deplib $compile_deplibs"
  1.2106 +	    finalize_deplibs="$deplib $finalize_deplibs"
  1.2107 +	  else
  1.2108 +	    compiler_flags="$compiler_flags $deplib"
  1.2109 +	  fi
  1.2110 +	  continue
  1.2111 +	  ;;
  1.2112 +	-l*)
  1.2113 +	  if test "$linkmode" != lib && test "$linkmode" != prog; then
  1.2114 +	    $echo "$modename: warning: \`-l' is ignored for archives/objects" 1>&2
  1.2115 +	    continue
  1.2116 +	  fi
  1.2117 +	  name=`$echo "X$deplib" | $Xsed -e 's/^-l//'`
  1.2118 +	  for searchdir in $newlib_search_path $lib_search_path $sys_lib_search_path $shlib_search_path; do
  1.2119 +	    for search_ext in .la $std_shrext .so .a; do
  1.2120 +	      # Search the libtool library
  1.2121 +	      lib="$searchdir/lib${name}${search_ext}"
  1.2122 +	      if test -f "$lib"; then
  1.2123 +		if test "$search_ext" = ".la"; then
  1.2124 +		  found=yes
  1.2125 +		else
  1.2126 +		  found=no
  1.2127 +		fi
  1.2128 +		break 2
  1.2129 +	      fi
  1.2130 +	    done
  1.2131 +	  done
  1.2132 +	  if test "$found" != yes; then
  1.2133 +	    # deplib doesn't seem to be a libtool library
  1.2134 +	    if test "$linkmode,$pass" = "prog,link"; then
  1.2135 +	      compile_deplibs="$deplib $compile_deplibs"
  1.2136 +	      finalize_deplibs="$deplib $finalize_deplibs"
  1.2137 +	    else
  1.2138 +	      deplibs="$deplib $deplibs"
  1.2139 +	      test "$linkmode" = lib && newdependency_libs="$deplib $newdependency_libs"
  1.2140 +	    fi
  1.2141 +	    continue
  1.2142 +	  else # deplib is a libtool library
  1.2143 +	    # If $allow_libtool_libs_with_static_runtimes && $deplib is a stdlib,
  1.2144 +	    # We need to do some special things here, and not later.
  1.2145 +	    if test "X$allow_libtool_libs_with_static_runtimes" = "Xyes" ; then
  1.2146 +	      case " $predeps $postdeps " in
  1.2147 +	      *" $deplib "*)
  1.2148 +		if (${SED} -e '2q' $lib |
  1.2149 +                    grep "^# Generated by .*$PACKAGE") >/dev/null 2>&1; then
  1.2150 +		  library_names=
  1.2151 +		  old_library=
  1.2152 +		  case $lib in
  1.2153 +		  */* | *\\*) . $lib ;;
  1.2154 +		  *) . ./$lib ;;
  1.2155 +		  esac
  1.2156 +		  for l in $old_library $library_names; do
  1.2157 +		    ll="$l"
  1.2158 +		  done
  1.2159 +		  if test "X$ll" = "X$old_library" ; then # only static version available
  1.2160 +		    found=no
  1.2161 +		    ladir=`$echo "X$lib" | $Xsed -e 's%/[^/]*$%%'`
  1.2162 +		    test "X$ladir" = "X$lib" && ladir="."
  1.2163 +		    lib=$ladir/$old_library
  1.2164 +		    if test "$linkmode,$pass" = "prog,link"; then
  1.2165 +		      compile_deplibs="$deplib $compile_deplibs"
  1.2166 +		      finalize_deplibs="$deplib $finalize_deplibs"
  1.2167 +		    else
  1.2168 +		      deplibs="$deplib $deplibs"
  1.2169 +		      test "$linkmode" = lib && newdependency_libs="$deplib $newdependency_libs"
  1.2170 +		    fi
  1.2171 +		    continue
  1.2172 +		  fi
  1.2173 +		fi
  1.2174 +	        ;;
  1.2175 +	      *) ;;
  1.2176 +	      esac
  1.2177 +	    fi
  1.2178 +	  fi
  1.2179 +	  ;; # -l
  1.2180 +	-L*)
  1.2181 +	  case $linkmode in
  1.2182 +	  lib)
  1.2183 +	    deplibs="$deplib $deplibs"
  1.2184 +	    test "$pass" = conv && continue
  1.2185 +	    newdependency_libs="$deplib $newdependency_libs"
  1.2186 +	    newlib_search_path="$newlib_search_path "`$echo "X$deplib" | $Xsed -e 's/^-L//'`
  1.2187 +	    ;;
  1.2188 +	  prog)
  1.2189 +	    if test "$pass" = conv; then
  1.2190 +	      deplibs="$deplib $deplibs"
  1.2191 +	      continue
  1.2192 +	    fi
  1.2193 +	    if test "$pass" = scan; then
  1.2194 +	      deplibs="$deplib $deplibs"
  1.2195 +	    else
  1.2196 +	      compile_deplibs="$deplib $compile_deplibs"
  1.2197 +	      finalize_deplibs="$deplib $finalize_deplibs"
  1.2198 +	    fi
  1.2199 +	    newlib_search_path="$newlib_search_path "`$echo "X$deplib" | $Xsed -e 's/^-L//'`
  1.2200 +	    ;;
  1.2201 +	  *)
  1.2202 +	    $echo "$modename: warning: \`-L' is ignored for archives/objects" 1>&2
  1.2203 +	    ;;
  1.2204 +	  esac # linkmode
  1.2205 +	  continue
  1.2206 +	  ;; # -L
  1.2207 +	-R*)
  1.2208 +	  if test "$pass" = link; then
  1.2209 +	    dir=`$echo "X$deplib" | $Xsed -e 's/^-R//'`
  1.2210 +	    # Make sure the xrpath contains only unique directories.
  1.2211 +	    case "$xrpath " in
  1.2212 +	    *" $dir "*) ;;
  1.2213 +	    *) xrpath="$xrpath $dir" ;;
  1.2214 +	    esac
  1.2215 +	  fi
  1.2216 +	  deplibs="$deplib $deplibs"
  1.2217 +	  continue
  1.2218 +	  ;;
  1.2219 +	*.la) lib="$deplib" ;;
  1.2220 +	*.$libext)
  1.2221 +	  if test "$pass" = conv; then
  1.2222 +	    deplibs="$deplib $deplibs"
  1.2223 +	    continue
  1.2224 +	  fi
  1.2225 +	  case $linkmode in
  1.2226 +	  lib)
  1.2227 +	    valid_a_lib=no
  1.2228 +	    case $deplibs_check_method in
  1.2229 +	      match_pattern*)
  1.2230 +		set dummy $deplibs_check_method
  1.2231 +	        match_pattern_regex=`expr "$deplibs_check_method" : "$2 \(.*\)"`
  1.2232 +		if eval $echo \"$deplib\" 2>/dev/null \
  1.2233 +		    | $SED 10q \
  1.2234 +		    | $EGREP "$match_pattern_regex" > /dev/null; then
  1.2235 +		  valid_a_lib=yes
  1.2236 +		fi
  1.2237 +		;;
  1.2238 +	      pass_all)
  1.2239 +		valid_a_lib=yes
  1.2240 +		;;
  1.2241 +            esac
  1.2242 +	    if test "$valid_a_lib" != yes; then
  1.2243 +	      $echo
  1.2244 +	      $echo "*** Warning: Trying to link with static lib archive $deplib."
  1.2245 +	      $echo "*** I have the capability to make that library automatically link in when"
  1.2246 +	      $echo "*** you link to this library.  But I can only do this if you have a"
  1.2247 +	      $echo "*** shared version of the library, which you do not appear to have"
  1.2248 +	      $echo "*** because the file extensions .$libext of this argument makes me believe"
  1.2249 +	      $echo "*** that it is just a static archive that I should not used here."
  1.2250 +	    else
  1.2251 +	      $echo
  1.2252 +	      $echo "*** Warning: Linking the shared library $output against the"
  1.2253 +	      $echo "*** static library $deplib is not portable!"
  1.2254 +	      deplibs="$deplib $deplibs"
  1.2255 +	    fi
  1.2256 +	    continue
  1.2257 +	    ;;
  1.2258 +	  prog)
  1.2259 +	    if test "$pass" != link; then
  1.2260 +	      deplibs="$deplib $deplibs"
  1.2261 +	    else
  1.2262 +	      compile_deplibs="$deplib $compile_deplibs"
  1.2263 +	      finalize_deplibs="$deplib $finalize_deplibs"
  1.2264 +	    fi
  1.2265 +	    continue
  1.2266 +	    ;;
  1.2267 +	  esac # linkmode
  1.2268 +	  ;; # *.$libext
  1.2269 +	*.lo | *.$objext)
  1.2270 +	  if test "$pass" = conv; then
  1.2271 +	    deplibs="$deplib $deplibs"
  1.2272 +	  elif test "$linkmode" = prog; then
  1.2273 +	    if test "$pass" = dlpreopen || test "$dlopen_support" != yes || test "$build_libtool_libs" = no; then
  1.2274 +	      # If there is no dlopen support or we're linking statically,
  1.2275 +	      # we need to preload.
  1.2276 +	      newdlprefiles="$newdlprefiles $deplib"
  1.2277 +	      compile_deplibs="$deplib $compile_deplibs"
  1.2278 +	      finalize_deplibs="$deplib $finalize_deplibs"
  1.2279 +	    else
  1.2280 +	      newdlfiles="$newdlfiles $deplib"
  1.2281 +	    fi
  1.2282 +	  fi
  1.2283 +	  continue
  1.2284 +	  ;;
  1.2285 +	%DEPLIBS%)
  1.2286 +	  alldeplibs=yes
  1.2287 +	  continue
  1.2288 +	  ;;
  1.2289 +	esac # case $deplib
  1.2290 +	if test "$found" = yes || test -f "$lib"; then :
  1.2291 +	else
  1.2292 +	  $echo "$modename: cannot find the library \`$lib' or unhandled argument \`$deplib'" 1>&2
  1.2293 +	  exit $EXIT_FAILURE
  1.2294 +	fi
  1.2295 +
  1.2296 +	# Check to see that this really is a libtool archive.
  1.2297 +	if (${SED} -e '2q' $lib | grep "^# Generated by .*$PACKAGE") >/dev/null 2>&1; then :
  1.2298 +	else
  1.2299 +	  $echo "$modename: \`$lib' is not a valid libtool archive" 1>&2
  1.2300 +	  exit $EXIT_FAILURE
  1.2301 +	fi
  1.2302 +
  1.2303 +	ladir=`$echo "X$lib" | $Xsed -e 's%/[^/]*$%%'`
  1.2304 +	test "X$ladir" = "X$lib" && ladir="."
  1.2305 +
  1.2306 +	dlname=
  1.2307 +	dlopen=
  1.2308 +	dlpreopen=
  1.2309 +	libdir=
  1.2310 +	library_names=
  1.2311 +	old_library=
  1.2312 +	# If the library was installed with an old release of libtool,
  1.2313 +	# it will not redefine variables installed, or shouldnotlink
  1.2314 +	installed=yes
  1.2315 +	shouldnotlink=no
  1.2316 +	avoidtemprpath=
  1.2317 +
  1.2318 +
  1.2319 +	# Read the .la file
  1.2320 +	case $lib in
  1.2321 +	*/* | *\\*) . $lib ;;
  1.2322 +	*) . ./$lib ;;
  1.2323 +	esac
  1.2324 +
  1.2325 +	if test "$linkmode,$pass" = "lib,link" ||
  1.2326 +	   test "$linkmode,$pass" = "prog,scan" ||
  1.2327 +	   { test "$linkmode" != prog && test "$linkmode" != lib; }; then
  1.2328 +	  test -n "$dlopen" && dlfiles="$dlfiles $dlopen"
  1.2329 +	  test -n "$dlpreopen" && dlprefiles="$dlprefiles $dlpreopen"
  1.2330 +	fi
  1.2331 +
  1.2332 +	if test "$pass" = conv; then
  1.2333 +	  # Only check for convenience libraries
  1.2334 +	  deplibs="$lib $deplibs"
  1.2335 +	  if test -z "$libdir"; then
  1.2336 +	    if test -z "$old_library"; then
  1.2337 +	      $echo "$modename: cannot find name of link library for \`$lib'" 1>&2
  1.2338 +	      exit $EXIT_FAILURE
  1.2339 +	    fi
  1.2340 +	    # It is a libtool convenience library, so add in its objects.
  1.2341 +	    convenience="$convenience $ladir/$objdir/$old_library"
  1.2342 +	    old_convenience="$old_convenience $ladir/$objdir/$old_library"
  1.2343 +	    tmp_libs=
  1.2344 +	    for deplib in $dependency_libs; do
  1.2345 +	      deplibs="$deplib $deplibs"
  1.2346 +              if test "X$duplicate_deps" = "Xyes" ; then
  1.2347 +	        case "$tmp_libs " in
  1.2348 +	        *" $deplib "*) specialdeplibs="$specialdeplibs $deplib" ;;
  1.2349 +	        esac
  1.2350 +              fi
  1.2351 +	      tmp_libs="$tmp_libs $deplib"
  1.2352 +	    done
  1.2353 +	  elif test "$linkmode" != prog && test "$linkmode" != lib; then
  1.2354 +	    $echo "$modename: \`$lib' is not a convenience library" 1>&2
  1.2355 +	    exit $EXIT_FAILURE
  1.2356 +	  fi
  1.2357 +	  continue
  1.2358 +	fi # $pass = conv
  1.2359 +
  1.2360 +
  1.2361 +	# Get the name of the library we link against.
  1.2362 +	linklib=
  1.2363 +	for l in $old_library $library_names; do
  1.2364 +	  linklib="$l"
  1.2365 +	done
  1.2366 +	if test -z "$linklib"; then
  1.2367 +	  $echo "$modename: cannot find name of link library for \`$lib'" 1>&2
  1.2368 +	  exit $EXIT_FAILURE
  1.2369 +	fi
  1.2370 +
  1.2371 +	# This library was specified with -dlopen.
  1.2372 +	if test "$pass" = dlopen; then
  1.2373 +	  if test -z "$libdir"; then
  1.2374 +	    $echo "$modename: cannot -dlopen a convenience library: \`$lib'" 1>&2
  1.2375 +	    exit $EXIT_FAILURE
  1.2376 +	  fi
  1.2377 +	  if test -z "$dlname" ||
  1.2378 +	     test "$dlopen_support" != yes ||
  1.2379 +	     test "$build_libtool_libs" = no; then
  1.2380 +	    # If there is no dlname, no dlopen support or we're linking
  1.2381 +	    # statically, we need to preload.  We also need to preload any
  1.2382 +	    # dependent libraries so libltdl's deplib preloader doesn't
  1.2383 +	    # bomb out in the load deplibs phase.
  1.2384 +	    dlprefiles="$dlprefiles $lib $dependency_libs"
  1.2385 +	  else
  1.2386 +	    newdlfiles="$newdlfiles $lib"
  1.2387 +	  fi
  1.2388 +	  continue
  1.2389 +	fi # $pass = dlopen
  1.2390 +
  1.2391 +	# We need an absolute path.
  1.2392 +	case $ladir in
  1.2393 +	[\\/]* | [A-Za-z]:[\\/]*) abs_ladir="$ladir" ;;
  1.2394 +	*)
  1.2395 +	  abs_ladir=`cd "$ladir" && pwd`
  1.2396 +	  if test -z "$abs_ladir"; then
  1.2397 +	    $echo "$modename: warning: cannot determine absolute directory name of \`$ladir'" 1>&2
  1.2398 +	    $echo "$modename: passing it literally to the linker, although it might fail" 1>&2
  1.2399 +	    abs_ladir="$ladir"
  1.2400 +	  fi
  1.2401 +	  ;;
  1.2402 +	esac
  1.2403 +	laname=`$echo "X$lib" | $Xsed -e 's%^.*/%%'`
  1.2404 +
  1.2405 +	# Find the relevant object directory and library name.
  1.2406 +	if test "X$installed" = Xyes; then
  1.2407 +	  if test ! -f "$libdir/$linklib" && test -f "$abs_ladir/$linklib"; then
  1.2408 +	    $echo "$modename: warning: library \`$lib' was moved." 1>&2
  1.2409 +	    dir="$ladir"
  1.2410 +	    absdir="$abs_ladir"
  1.2411 +	    libdir="$abs_ladir"
  1.2412 +	  else
  1.2413 +	    dir="$libdir"
  1.2414 +	    absdir="$libdir"
  1.2415 +	  fi
  1.2416 +	  test "X$hardcode_automatic" = Xyes && avoidtemprpath=yes
  1.2417 +	else
  1.2418 +	  if test ! -f "$ladir/$objdir/$linklib" && test -f "$abs_ladir/$linklib"; then
  1.2419 +	    dir="$ladir"
  1.2420 +	    absdir="$abs_ladir"
  1.2421 +	    # Remove this search path later
  1.2422 +	    notinst_path="$notinst_path $abs_ladir"
  1.2423 +	  else
  1.2424 +	    dir="$ladir/$objdir"
  1.2425 +	    absdir="$abs_ladir/$objdir"
  1.2426 +	    # Remove this search path later
  1.2427 +	    notinst_path="$notinst_path $abs_ladir"
  1.2428 +	  fi
  1.2429 +	fi # $installed = yes
  1.2430 +	name=`$echo "X$laname" | $Xsed -e 's/\.la$//' -e 's/^lib//'`
  1.2431 +
  1.2432 +	# This library was specified with -dlpreopen.
  1.2433 +	if test "$pass" = dlpreopen; then
  1.2434 +	  if test -z "$libdir"; then
  1.2435 +	    $echo "$modename: cannot -dlpreopen a convenience library: \`$lib'" 1>&2
  1.2436 +	    exit $EXIT_FAILURE
  1.2437 +	  fi
  1.2438 +	  # Prefer using a static library (so that no silly _DYNAMIC symbols
  1.2439 +	  # are required to link).
  1.2440 +	  if test -n "$old_library"; then
  1.2441 +	    newdlprefiles="$newdlprefiles $dir/$old_library"
  1.2442 +	  # Otherwise, use the dlname, so that lt_dlopen finds it.
  1.2443 +	  elif test -n "$dlname"; then
  1.2444 +	    newdlprefiles="$newdlprefiles $dir/$dlname"
  1.2445 +	  else
  1.2446 +	    newdlprefiles="$newdlprefiles $dir/$linklib"
  1.2447 +	  fi
  1.2448 +	fi # $pass = dlpreopen
  1.2449 +
  1.2450 +	if test -z "$libdir"; then
  1.2451 +	  # Link the convenience library
  1.2452 +	  if test "$linkmode" = lib; then
  1.2453 +	    deplibs="$dir/$old_library $deplibs"
  1.2454 +	  elif test "$linkmode,$pass" = "prog,link"; then
  1.2455 +	    compile_deplibs="$dir/$old_library $compile_deplibs"
  1.2456 +	    finalize_deplibs="$dir/$old_library $finalize_deplibs"
  1.2457 +	  else
  1.2458 +	    deplibs="$lib $deplibs" # used for prog,scan pass
  1.2459 +	  fi
  1.2460 +	  continue
  1.2461 +	fi
  1.2462 +
  1.2463 +
  1.2464 +	if test "$linkmode" = prog && test "$pass" != link; then
  1.2465 +	  newlib_search_path="$newlib_search_path $ladir"
  1.2466 +	  deplibs="$lib $deplibs"
  1.2467 +
  1.2468 +	  linkalldeplibs=no
  1.2469 +	  if test "$link_all_deplibs" != no || test -z "$library_names" ||
  1.2470 +	     test "$build_libtool_libs" = no; then
  1.2471 +	    linkalldeplibs=yes
  1.2472 +	  fi
  1.2473 +
  1.2474 +	  tmp_libs=
  1.2475 +	  for deplib in $dependency_libs; do
  1.2476 +	    case $deplib in
  1.2477 +	    -L*) newlib_search_path="$newlib_search_path "`$echo "X$deplib" | $Xsed -e 's/^-L//'`;; ### testsuite: skip nested quoting test
  1.2478 +	    esac
  1.2479 +	    # Need to link against all dependency_libs?
  1.2480 +	    if test "$linkalldeplibs" = yes; then
  1.2481 +	      deplibs="$deplib $deplibs"
  1.2482 +	    else
  1.2483 +	      # Need to hardcode shared library paths
  1.2484 +	      # or/and link against static libraries
  1.2485 +	      newdependency_libs="$deplib $newdependency_libs"
  1.2486 +	    fi
  1.2487 +	    if test "X$duplicate_deps" = "Xyes" ; then
  1.2488 +	      case "$tmp_libs " in
  1.2489 +	      *" $deplib "*) specialdeplibs="$specialdeplibs $deplib" ;;
  1.2490 +	      esac
  1.2491 +	    fi
  1.2492 +	    tmp_libs="$tmp_libs $deplib"
  1.2493 +	  done # for deplib
  1.2494 +	  continue
  1.2495 +	fi # $linkmode = prog...
  1.2496 +
  1.2497 +	if test "$linkmode,$pass" = "prog,link"; then
  1.2498 +	  if test -n "$library_names" &&
  1.2499 +	     { test "$prefer_static_libs" = no || test -z "$old_library"; }; then
  1.2500 +	    # We need to hardcode the library path
  1.2501 +	    if test -n "$shlibpath_var" && test -z "$avoidtemprpath" ; then
  1.2502 +	      # Make sure the rpath contains only unique directories.
  1.2503 +	      case "$temp_rpath " in
  1.2504 +	      *" $dir "*) ;;
  1.2505 +	      *" $absdir "*) ;;
  1.2506 +	      *) temp_rpath="$temp_rpath $absdir" ;;
  1.2507 +	      esac
  1.2508 +	    fi
  1.2509 +
  1.2510 +	    # Hardcode the library path.
  1.2511 +	    # Skip directories that are in the system default run-time
  1.2512 +	    # search path.
  1.2513 +	    case " $sys_lib_dlsearch_path " in
  1.2514 +	    *" $absdir "*) ;;
  1.2515 +	    *)
  1.2516 +	      case "$compile_rpath " in
  1.2517 +	      *" $absdir "*) ;;
  1.2518 +	      *) compile_rpath="$compile_rpath $absdir"
  1.2519 +	      esac
  1.2520 +	      ;;
  1.2521 +	    esac
  1.2522 +	    case " $sys_lib_dlsearch_path " in
  1.2523 +	    *" $libdir "*) ;;
  1.2524 +	    *)
  1.2525 +	      case "$finalize_rpath " in
  1.2526 +	      *" $libdir "*) ;;
  1.2527 +	      *) finalize_rpath="$finalize_rpath $libdir"
  1.2528 +	      esac
  1.2529 +	      ;;
  1.2530 +	    esac
  1.2531 +	  fi # $linkmode,$pass = prog,link...
  1.2532 +
  1.2533 +	  if test "$alldeplibs" = yes &&
  1.2534 +	     { test "$deplibs_check_method" = pass_all ||
  1.2535 +	       { test "$build_libtool_libs" = yes &&
  1.2536 +		 test -n "$library_names"; }; }; then
  1.2537 +	    # We only need to search for static libraries
  1.2538 +	    continue
  1.2539 +	  fi
  1.2540 +	fi
  1.2541 +
  1.2542 +	link_static=no # Whether the deplib will be linked statically
  1.2543 +	use_static_libs=$prefer_static_libs
  1.2544 +	if test "$use_static_libs" = built && test "$installed" = yes ; then
  1.2545 +	  use_static_libs=no
  1.2546 +	fi
  1.2547 +	if test -n "$library_names" &&
  1.2548 +	   { test "$use_static_libs" = no || test -z "$old_library"; }; then
  1.2549 +	  if test "$installed" = no; then
  1.2550 +	    notinst_deplibs="$notinst_deplibs $lib"
  1.2551 +	    need_relink=yes
  1.2552 +	  fi
  1.2553 +	  # This is a shared library
  1.2554 +
  1.2555 +	  # Warn about portability, can't link against -module's on
  1.2556 +	  # some systems (darwin)
  1.2557 +	  if test "$shouldnotlink" = yes && test "$pass" = link ; then
  1.2558 +	    $echo
  1.2559 +	    if test "$linkmode" = prog; then
  1.2560 +	      $echo "*** Warning: Linking the executable $output against the loadable module"
  1.2561 +	    else
  1.2562 +	      $echo "*** Warning: Linking the shared library $output against the loadable module"
  1.2563 +	    fi
  1.2564 +	    $echo "*** $linklib is not portable!"
  1.2565 +	  fi
  1.2566 +	  if test "$linkmode" = lib &&
  1.2567 +	     test "$hardcode_into_libs" = yes; then
  1.2568 +	    # Hardcode the library path.
  1.2569 +	    # Skip directories that are in the system default run-time
  1.2570 +	    # search path.
  1.2571 +	    case " $sys_lib_dlsearch_path " in
  1.2572 +	    *" $absdir "*) ;;
  1.2573 +	    *)
  1.2574 +	      case "$compile_rpath " in
  1.2575 +	      *" $absdir "*) ;;
  1.2576 +	      *) compile_rpath="$compile_rpath $absdir"
  1.2577 +	      esac
  1.2578 +	      ;;
  1.2579 +	    esac
  1.2580 +	    case " $sys_lib_dlsearch_path " in
  1.2581 +	    *" $libdir "*) ;;
  1.2582 +	    *)
  1.2583 +	      case "$finalize_rpath " in
  1.2584 +	      *" $libdir "*) ;;
  1.2585 +	      *) finalize_rpath="$finalize_rpath $libdir"
  1.2586 +	      esac
  1.2587 +	      ;;
  1.2588 +	    esac
  1.2589 +	  fi
  1.2590 +
  1.2591 +	  if test -n "$old_archive_from_expsyms_cmds"; then
  1.2592 +	    # figure out the soname
  1.2593 +	    set dummy $library_names
  1.2594 +	    realname="$2"
  1.2595 +	    shift; shift
  1.2596 +	    libname=`eval \\$echo \"$libname_spec\"`
  1.2597 +	    # use dlname if we got it. it's perfectly good, no?
  1.2598 +	    if test -n "$dlname"; then
  1.2599 +	      soname="$dlname"
  1.2600 +	    elif test -n "$soname_spec"; then
  1.2601 +	      # bleh windows
  1.2602 +	      case $host in
  1.2603 +	      *cygwin* | mingw*)
  1.2604 +		major=`expr $current - $age`
  1.2605 +		versuffix="-$major"
  1.2606 +		;;
  1.2607 +	      esac
  1.2608 +	      eval soname=\"$soname_spec\"
  1.2609 +	    else
  1.2610 +	      soname="$realname"
  1.2611 +	    fi
  1.2612 +
  1.2613 +	    # Make a new name for the extract_expsyms_cmds to use
  1.2614 +	    soroot="$soname"
  1.2615 +	    soname=`$echo $soroot | ${SED} -e 's/^.*\///'`
  1.2616 +	    newlib="libimp-`$echo $soname | ${SED} 's/^lib//;s/\.dll$//'`.a"
  1.2617 +
  1.2618 +	    # If the library has no export list, then create one now
  1.2619 +	    if test -f "$output_objdir/$soname-def"; then :
  1.2620 +	    else
  1.2621 +	      $show "extracting exported symbol list from \`$soname'"
  1.2622 +	      save_ifs="$IFS"; IFS='~'
  1.2623 +	      cmds=$extract_expsyms_cmds
  1.2624 +	      for cmd in $cmds; do
  1.2625 +		IFS="$save_ifs"
  1.2626 +		eval cmd=\"$cmd\"
  1.2627 +		$show "$cmd"
  1.2628 +		$run eval "$cmd" || exit $?
  1.2629 +	      done
  1.2630 +	      IFS="$save_ifs"
  1.2631 +	    fi
  1.2632 +
  1.2633 +	    # Create $newlib
  1.2634 +	    if test -f "$output_objdir/$newlib"; then :; else
  1.2635 +	      $show "generating import library for \`$soname'"
  1.2636 +	      save_ifs="$IFS"; IFS='~'
  1.2637 +	      cmds=$old_archive_from_expsyms_cmds
  1.2638 +	      for cmd in $cmds; do
  1.2639 +		IFS="$save_ifs"
  1.2640 +		eval cmd=\"$cmd\"
  1.2641 +		$show "$cmd"
  1.2642 +		$run eval "$cmd" || exit $?
  1.2643 +	      done
  1.2644 +	      IFS="$save_ifs"
  1.2645 +	    fi
  1.2646 +	    # make sure the library variables are pointing to the new library
  1.2647 +	    dir=$output_objdir
  1.2648 +	    linklib=$newlib
  1.2649 +	  fi # test -n "$old_archive_from_expsyms_cmds"
  1.2650 +
  1.2651 +	  if test "$linkmode" = prog || test "$mode" != relink; then
  1.2652 +	    add_shlibpath=
  1.2653 +	    add_dir=
  1.2654 +	    add=
  1.2655 +	    lib_linked=yes
  1.2656 +	    case $hardcode_action in
  1.2657 +	    immediate | unsupported)
  1.2658 +	      if test "$hardcode_direct" = no; then
  1.2659 +		add="$dir/$linklib"
  1.2660 +		case $host in
  1.2661 +		  *-*-sco3.2v5.0.[024]*) add_dir="-L$dir" ;;
  1.2662 +		  *-*-sysv4*uw2*) add_dir="-L$dir" ;;
  1.2663 +		  *-*-sysv5OpenUNIX* | *-*-sysv5UnixWare7.[01].[10]* | \
  1.2664 +		    *-*-unixware7*) add_dir="-L$dir" ;;
  1.2665 +		  *-*-darwin* )
  1.2666 +		    # if the lib is a module then we can not link against
  1.2667 +		    # it, someone is ignoring the new warnings I added
  1.2668 +		    if /usr/bin/file -L $add 2> /dev/null |
  1.2669 +                      $EGREP ": [^:]* bundle" >/dev/null ; then
  1.2670 +		      $echo "** Warning, lib $linklib is a module, not a shared library"
  1.2671 +		      if test -z "$old_library" ; then
  1.2672 +		        $echo
  1.2673 +		        $echo "** And there doesn't seem to be a static archive available"
  1.2674 +		        $echo "** The link will probably fail, sorry"
  1.2675 +		      else
  1.2676 +		        add="$dir/$old_library"
  1.2677 +		      fi
  1.2678 +		    fi
  1.2679 +		esac
  1.2680 +	      elif test "$hardcode_minus_L" = no; then
  1.2681 +		case $host in
  1.2682 +		*-*-sunos*) add_shlibpath="$dir" ;;
  1.2683 +		esac
  1.2684 +		add_dir="-L$dir"
  1.2685 +		add="-l$name"
  1.2686 +	      elif test "$hardcode_shlibpath_var" = no; then
  1.2687 +		add_shlibpath="$dir"
  1.2688 +		add="-l$name"
  1.2689 +	      else
  1.2690 +		lib_linked=no
  1.2691 +	      fi
  1.2692 +	      ;;
  1.2693 +	    relink)
  1.2694 +	      if test "$hardcode_direct" = yes; then
  1.2695 +		add="$dir/$linklib"
  1.2696 +	      elif test "$hardcode_minus_L" = yes; then
  1.2697 +		add_dir="-L$dir"
  1.2698 +		# Try looking first in the location we're being installed to.
  1.2699 +		if test -n "$inst_prefix_dir"; then
  1.2700 +		  case $libdir in
  1.2701 +		    [\\/]*)
  1.2702 +		      add_dir="$add_dir -L$inst_prefix_dir$libdir"
  1.2703 +		      ;;
  1.2704 +		  esac
  1.2705 +		fi
  1.2706 +		add="-l$name"
  1.2707 +	      elif test "$hardcode_shlibpath_var" = yes; then
  1.2708 +		add_shlibpath="$dir"
  1.2709 +		add="-l$name"
  1.2710 +	      else
  1.2711 +		lib_linked=no
  1.2712 +	      fi
  1.2713 +	      ;;
  1.2714 +	    *) lib_linked=no ;;
  1.2715 +	    esac
  1.2716 +
  1.2717 +	    if test "$lib_linked" != yes; then
  1.2718 +	      $echo "$modename: configuration error: unsupported hardcode properties"
  1.2719 +	      exit $EXIT_FAILURE
  1.2720 +	    fi
  1.2721 +
  1.2722 +	    if test -n "$add_shlibpath"; then
  1.2723 +	      case :$compile_shlibpath: in
  1.2724 +	      *":$add_shlibpath:"*) ;;
  1.2725 +	      *) compile_shlibpath="$compile_shlibpath$add_shlibpath:" ;;
  1.2726 +	      esac
  1.2727 +	    fi
  1.2728 +	    if test "$linkmode" = prog; then
  1.2729 +	      test -n "$add_dir" && compile_deplibs="$add_dir $compile_deplibs"
  1.2730 +	      test -n "$add" && compile_deplibs="$add $compile_deplibs"
  1.2731 +	    else
  1.2732 +	      test -n "$add_dir" && deplibs="$add_dir $deplibs"
  1.2733 +	      test -n "$add" && deplibs="$add $deplibs"
  1.2734 +	      if test "$hardcode_direct" != yes && \
  1.2735 +		 test "$hardcode_minus_L" != yes && \
  1.2736 +		 test "$hardcode_shlibpath_var" = yes; then
  1.2737 +		case :$finalize_shlibpath: in
  1.2738 +		*":$libdir:"*) ;;
  1.2739 +		*) finalize_shlibpath="$finalize_shlibpath$libdir:" ;;
  1.2740 +		esac
  1.2741 +	      fi
  1.2742 +	    fi
  1.2743 +	  fi
  1.2744 +
  1.2745 +	  if test "$linkmode" = prog || test "$mode" = relink; then
  1.2746 +	    add_shlibpath=
  1.2747 +	    add_dir=
  1.2748 +	    add=
  1.2749 +	    # Finalize command for both is simple: just hardcode it.
  1.2750 +	    if test "$hardcode_direct" = yes; then
  1.2751 +	      add="$libdir/$linklib"
  1.2752 +	    elif test "$hardcode_minus_L" = yes; then
  1.2753 +	      add_dir="-L$libdir"
  1.2754 +	      add="-l$name"
  1.2755 +	    elif test "$hardcode_shlibpath_var" = yes; then
  1.2756 +	      case :$finalize_shlibpath: in
  1.2757 +	      *":$libdir:"*) ;;
  1.2758 +	      *) finalize_shlibpath="$finalize_shlibpath$libdir:" ;;
  1.2759 +	      esac
  1.2760 +	      add="-l$name"
  1.2761 +	    elif test "$hardcode_automatic" = yes; then
  1.2762 +	      if test -n "$inst_prefix_dir" &&
  1.2763 +		 test -f "$inst_prefix_dir$libdir/$linklib" ; then
  1.2764 +	        add="$inst_prefix_dir$libdir/$linklib"
  1.2765 +	      else
  1.2766 +	        add="$libdir/$linklib"
  1.2767 +	      fi
  1.2768 +	    else
  1.2769 +	      # We cannot seem to hardcode it, guess we'll fake it.
  1.2770 +	      add_dir="-L$libdir"
  1.2771 +	      # Try looking first in the location we're being installed to.
  1.2772 +	      if test -n "$inst_prefix_dir"; then
  1.2773 +		case $libdir in
  1.2774 +		  [\\/]*)
  1.2775 +		    add_dir="$add_dir -L$inst_prefix_dir$libdir"
  1.2776 +		    ;;
  1.2777 +		esac
  1.2778 +	      fi
  1.2779 +	      add="-l$name"
  1.2780 +	    fi
  1.2781 +
  1.2782 +	    if test "$linkmode" = prog; then
  1.2783 +	      test -n "$add_dir" && finalize_deplibs="$add_dir $finalize_deplibs"
  1.2784 +	      test -n "$add" && finalize_deplibs="$add $finalize_deplibs"
  1.2785 +	    else
  1.2786 +	      test -n "$add_dir" && deplibs="$add_dir $deplibs"
  1.2787 +	      test -n "$add" && deplibs="$add $deplibs"
  1.2788 +	    fi
  1.2789 +	  fi
  1.2790 +	elif test "$linkmode" = prog; then
  1.2791 +	  # Here we assume that one of hardcode_direct or hardcode_minus_L
  1.2792 +	  # is not unsupported.  This is valid on all known static and
  1.2793 +	  # shared platforms.
  1.2794 +	  if test "$hardcode_direct" != unsupported; then
  1.2795 +	    test -n "$old_library" && linklib="$old_library"
  1.2796 +	    compile_deplibs="$dir/$linklib $compile_deplibs"
  1.2797 +	    finalize_deplibs="$dir/$linklib $finalize_deplibs"
  1.2798 +	  else
  1.2799 +	    compile_deplibs="-l$name -L$dir $compile_deplibs"
  1.2800 +	    finalize_deplibs="-l$name -L$dir $finalize_deplibs"
  1.2801 +	  fi
  1.2802 +	elif test "$build_libtool_libs" = yes; then
  1.2803 +	  # Not a shared library
  1.2804 +	  if test "$deplibs_check_method" != pass_all; then
  1.2805 +	    # We're trying link a shared library against a static one
  1.2806 +	    # but the system doesn't support it.
  1.2807 +
  1.2808 +	    # Just print a warning and add the library to dependency_libs so
  1.2809 +	    # that the program can be linked against the static library.
  1.2810 +	    $echo
  1.2811 +	    $echo "*** Warning: This system can not link to static lib archive $lib."
  1.2812 +	    $echo "*** I have the capability to make that library automatically link in when"
  1.2813 +	    $echo "*** you link to this library.  But I can only do this if you have a"
  1.2814 +	    $echo "*** shared version of the library, which you do not appear to have."
  1.2815 +	    if test "$module" = yes; then
  1.2816 +	      $echo "*** But as you try to build a module library, libtool will still create "
  1.2817 +	      $echo "*** a static module, that should work as long as the dlopening application"
  1.2818 +	      $echo "*** is linked with the -dlopen flag to resolve symbols at runtime."
  1.2819 +	      if test -z "$global_symbol_pipe"; then
  1.2820 +		$echo
  1.2821 +		$echo "*** However, this would only work if libtool was able to extract symbol"
  1.2822 +		$echo "*** lists from a program, using \`nm' or equivalent, but libtool could"
  1.2823 +		$echo "*** not find such a program.  So, this module is probably useless."
  1.2824 +		$echo "*** \`nm' from GNU binutils and a full rebuild may help."
  1.2825 +	      fi
  1.2826 +	      if test "$build_old_libs" = no; then
  1.2827 +		build_libtool_libs=module
  1.2828 +		build_old_libs=yes
  1.2829 +	      else
  1.2830 +		build_libtool_libs=no
  1.2831 +	      fi
  1.2832 +	    fi
  1.2833 +	  else
  1.2834 +	    deplibs="$dir/$old_library $deplibs"
  1.2835 +	    link_static=yes
  1.2836 +	  fi
  1.2837 +	fi # link shared/static library?
  1.2838 +
  1.2839 +	if test "$linkmode" = lib; then
  1.2840 +	  if test -n "$dependency_libs" &&
  1.2841 +	     { test "$hardcode_into_libs" != yes ||
  1.2842 +	       test "$build_old_libs" = yes ||
  1.2843 +	       test "$link_static" = yes; }; then
  1.2844 +	    # Extract -R from dependency_libs
  1.2845 +	    temp_deplibs=
  1.2846 +	    for libdir in $dependency_libs; do
  1.2847 +	      case $libdir in
  1.2848 +	      -R*) temp_xrpath=`$echo "X$libdir" | $Xsed -e 's/^-R//'`
  1.2849 +		   case " $xrpath " in
  1.2850 +		   *" $temp_xrpath "*) ;;
  1.2851 +		   *) xrpath="$xrpath $temp_xrpath";;
  1.2852 +		   esac;;
  1.2853 +	      *) temp_deplibs="$temp_deplibs $libdir";;
  1.2854 +	      esac
  1.2855 +	    done
  1.2856 +	    dependency_libs="$temp_deplibs"
  1.2857 +	  fi
  1.2858 +
  1.2859 +	  newlib_search_path="$newlib_search_path $absdir"
  1.2860 +	  # Link against this library
  1.2861 +	  test "$link_static" = no && newdependency_libs="$abs_ladir/$laname $newdependency_libs"
  1.2862 +	  # ... and its dependency_libs
  1.2863 +	  tmp_libs=
  1.2864 +	  for deplib in $dependency_libs; do
  1.2865 +	    newdependency_libs="$deplib $newdependency_libs"
  1.2866 +	    if test "X$duplicate_deps" = "Xyes" ; then
  1.2867 +	      case "$tmp_libs " in
  1.2868 +	      *" $deplib "*) specialdeplibs="$specialdeplibs $deplib" ;;
  1.2869 +	      esac
  1.2870 +	    fi
  1.2871 +	    tmp_libs="$tmp_libs $deplib"
  1.2872 +	  done
  1.2873 +
  1.2874 +	  if test "$link_all_deplibs" != no; then
  1.2875 +	    # Add the search paths of all dependency libraries
  1.2876 +	    for deplib in $dependency_libs; do
  1.2877 +	      case $deplib in
  1.2878 +	      -L*) path="$deplib" ;;
  1.2879 +	      *.la)
  1.2880 +		dir=`$echo "X$deplib" | $Xsed -e 's%/[^/]*$%%'`
  1.2881 +		test "X$dir" = "X$deplib" && dir="."
  1.2882 +		# We need an absolute path.
  1.2883 +		case $dir in
  1.2884 +		[\\/]* | [A-Za-z]:[\\/]*) absdir="$dir" ;;
  1.2885 +		*)
  1.2886 +		  absdir=`cd "$dir" && pwd`
  1.2887 +		  if test -z "$absdir"; then
  1.2888 +		    $echo "$modename: warning: cannot determine absolute directory name of \`$dir'" 1>&2
  1.2889 +		    absdir="$dir"
  1.2890 +		  fi
  1.2891 +		  ;;
  1.2892 +		esac
  1.2893 +		if grep "^installed=no" $deplib > /dev/null; then
  1.2894 +		  path="$absdir/$objdir"
  1.2895 +		else
  1.2896 +		  eval libdir=`${SED} -n -e 's/^libdir=\(.*\)$/\1/p' $deplib`
  1.2897 +		  if test -z "$libdir"; then
  1.2898 +		    $echo "$modename: \`$deplib' is not a valid libtool archive" 1>&2
  1.2899 +		    exit $EXIT_FAILURE
  1.2900 +		  fi
  1.2901 +		  if test "$absdir" != "$libdir"; then
  1.2902 +		    $echo "$modename: warning: \`$deplib' seems to be moved" 1>&2
  1.2903 +		  fi
  1.2904 +		  path="$absdir"
  1.2905 +		fi
  1.2906 +		depdepl=
  1.2907 +		case $host in
  1.2908 +		*-*-darwin*)
  1.2909 +		  # we do not want to link against static libs,
  1.2910 +		  # but need to link against shared
  1.2911 +		  eval deplibrary_names=`${SED} -n -e 's/^library_names=\(.*\)$/\1/p' $deplib`
  1.2912 +		  if test -n "$deplibrary_names" ; then
  1.2913 +		    for tmp in $deplibrary_names ; do
  1.2914 +		      depdepl=$tmp
  1.2915 +		    done
  1.2916 +		    if test -f "$path/$depdepl" ; then
  1.2917 +		      depdepl="$path/$depdepl"
  1.2918 +		    fi
  1.2919 +		    # do not add paths which are already there
  1.2920 +		    case " $newlib_search_path " in
  1.2921 +		    *" $path "*) ;;
  1.2922 +		    *) newlib_search_path="$newlib_search_path $path";;
  1.2923 +		    esac
  1.2924 +		  fi
  1.2925 +		  path=""
  1.2926 +		  ;;
  1.2927 +		*)
  1.2928 +		  path="-L$path"
  1.2929 +		  ;;
  1.2930 +		esac
  1.2931 +		;;
  1.2932 +	      -l*)
  1.2933 +		case $host in
  1.2934 +		*-*-darwin*)
  1.2935 +		  # Again, we only want to link against shared libraries
  1.2936 +		  eval tmp_libs=`$echo "X$deplib" | $Xsed -e "s,^\-l,,"`
  1.2937 +		  for tmp in $newlib_search_path ; do
  1.2938 +		    if test -f "$tmp/lib$tmp_libs.dylib" ; then
  1.2939 +		      eval depdepl="$tmp/lib$tmp_libs.dylib"
  1.2940 +		      break
  1.2941 +		    fi
  1.2942 +		  done
  1.2943 +		  path=""
  1.2944 +		  ;;
  1.2945 +		*) continue ;;
  1.2946 +		esac
  1.2947 +		;;
  1.2948 +	      *) continue ;;
  1.2949 +	      esac
  1.2950 +	      case " $deplibs " in
  1.2951 +	      *" $path "*) ;;
  1.2952 +	      *) deplibs="$path $deplibs" ;;
  1.2953 +	      esac
  1.2954 +	      case " $deplibs " in
  1.2955 +	      *" $depdepl "*) ;;
  1.2956 +	      *) deplibs="$depdepl $deplibs" ;;
  1.2957 +	      esac
  1.2958 +	    done
  1.2959 +	  fi # link_all_deplibs != no
  1.2960 +	fi # linkmode = lib
  1.2961 +      done # for deplib in $libs
  1.2962 +      dependency_libs="$newdependency_libs"
  1.2963 +      if test "$pass" = dlpreopen; then
  1.2964 +	# Link the dlpreopened libraries before other libraries
  1.2965 +	for deplib in $save_deplibs; do
  1.2966 +	  deplibs="$deplib $deplibs"
  1.2967 +	done
  1.2968 +      fi
  1.2969 +      if test "$pass" != dlopen; then
  1.2970 +	if test "$pass" != conv; then
  1.2971 +	  # Make sure lib_search_path contains only unique directories.
  1.2972 +	  lib_search_path=
  1.2973 +	  for dir in $newlib_search_path; do
  1.2974 +	    case "$lib_search_path " in
  1.2975 +	    *" $dir "*) ;;
  1.2976 +	    *) lib_search_path="$lib_search_path $dir" ;;
  1.2977 +	    esac
  1.2978 +	  done
  1.2979 +	  newlib_search_path=
  1.2980 +	fi
  1.2981 +
  1.2982 +	if test "$linkmode,$pass" != "prog,link"; then
  1.2983 +	  vars="deplibs"
  1.2984 +	else
  1.2985 +	  vars="compile_deplibs finalize_deplibs"
  1.2986 +	fi
  1.2987 +	for var in $vars dependency_libs; do
  1.2988 +	  # Add libraries to $var in reverse order
  1.2989 +	  eval tmp_libs=\"\$$var\"
  1.2990 +	  new_libs=
  1.2991 +	  for deplib in $tmp_libs; do
  1.2992 +	    # FIXME: Pedantically, this is the right thing to do, so
  1.2993 +	    #        that some nasty dependency loop isn't accidentally
  1.2994 +	    #        broken:
  1.2995 +	    #new_libs="$deplib $new_libs"
  1.2996 +	    # Pragmatically, this seems to cause very few problems in
  1.2997 +	    # practice:
  1.2998 +	    case $deplib in
  1.2999 +	    -L*) new_libs="$deplib $new_libs" ;;
  1.3000 +	    -R*) ;;
  1.3001 +	    *)
  1.3002 +	      # And here is the reason: when a library appears more
  1.3003 +	      # than once as an explicit dependence of a library, or
  1.3004 +	      # is implicitly linked in more than once by the
  1.3005 +	      # compiler, it is considered special, and multiple
  1.3006 +	      # occurrences thereof are not removed.  Compare this
  1.3007 +	      # with having the same library being listed as a
  1.3008 +	      # dependency of multiple other libraries: in this case,
  1.3009 +	      # we know (pedantically, we assume) the library does not
  1.3010 +	      # need to be listed more than once, so we keep only the
  1.3011 +	      # last copy.  This is not always right, but it is rare
  1.3012 +	      # enough that we require users that really mean to play
  1.3013 +	      # such unportable linking tricks to link the library
  1.3014 +	      # using -Wl,-lname, so that libtool does not consider it
  1.3015 +	      # for duplicate removal.
  1.3016 +	      case " $specialdeplibs " in
  1.3017 +	      *" $deplib "*) new_libs="$deplib $new_libs" ;;
  1.3018 +	      *)
  1.3019 +		case " $new_libs " in
  1.3020 +		*" $deplib "*) ;;
  1.3021 +		*) new_libs="$deplib $new_libs" ;;
  1.3022 +		esac
  1.3023 +		;;
  1.3024 +	      esac
  1.3025 +	      ;;
  1.3026 +	    esac
  1.3027 +	  done
  1.3028 +	  tmp_libs=
  1.3029 +	  for deplib in $new_libs; do
  1.3030 +	    case $deplib in
  1.3031 +	    -L*)
  1.3032 +	      case " $tmp_libs " in
  1.3033 +	      *" $deplib "*) ;;
  1.3034 +	      *) tmp_libs="$tmp_libs $deplib" ;;
  1.3035 +	      esac
  1.3036 +	      ;;
  1.3037 +	    *) tmp_libs="$tmp_libs $deplib" ;;
  1.3038 +	    esac
  1.3039 +	  done
  1.3040 +	  eval $var=\"$tmp_libs\"
  1.3041 +	done # for var
  1.3042 +      fi
  1.3043 +      # Last step: remove runtime libs from dependency_libs
  1.3044 +      # (they stay in deplibs)
  1.3045 +      tmp_libs=
  1.3046 +      for i in $dependency_libs ; do
  1.3047 +	case " $predeps $postdeps $compiler_lib_search_path " in
  1.3048 +	*" $i "*)
  1.3049 +	  i=""
  1.3050 +	  ;;
  1.3051 +	esac
  1.3052 +	if test -n "$i" ; then
  1.3053 +	  tmp_libs="$tmp_libs $i"
  1.3054 +	fi
  1.3055 +      done
  1.3056 +      dependency_libs=$tmp_libs
  1.3057 +    done # for pass
  1.3058 +    if test "$linkmode" = prog; then
  1.3059 +      dlfiles="$newdlfiles"
  1.3060 +      dlprefiles="$newdlprefiles"
  1.3061 +    fi
  1.3062 +
  1.3063 +    case $linkmode in
  1.3064 +    oldlib)
  1.3065 +      if test -n "$deplibs"; then
  1.3066 +	$echo "$modename: warning: \`-l' and \`-L' are ignored for archives" 1>&2
  1.3067 +      fi
  1.3068 +
  1.3069 +      if test -n "$dlfiles$dlprefiles" || test "$dlself" != no; then
  1.3070 +	$echo "$modename: warning: \`-dlopen' is ignored for archives" 1>&2
  1.3071 +      fi
  1.3072 +
  1.3073 +      if test -n "$rpath"; then
  1.3074 +	$echo "$modename: warning: \`-rpath' is ignored for archives" 1>&2
  1.3075 +      fi
  1.3076 +
  1.3077 +      if test -n "$xrpath"; then
  1.3078 +	$echo "$modename: warning: \`-R' is ignored for archives" 1>&2
  1.3079 +      fi
  1.3080 +
  1.3081 +      if test -n "$vinfo"; then
  1.3082 +	$echo "$modename: warning: \`-version-info/-version-number' is ignored for archives" 1>&2
  1.3083 +      fi
  1.3084 +
  1.3085 +      if test -n "$release"; then
  1.3086 +	$echo "$modename: warning: \`-release' is ignored for archives" 1>&2
  1.3087 +      fi
  1.3088 +
  1.3089 +      if test -n "$export_symbols" || test -n "$export_symbols_regex"; then
  1.3090 +	$echo "$modename: warning: \`-export-symbols' is ignored for archives" 1>&2
  1.3091 +      fi
  1.3092 +
  1.3093 +      # Now set the variables for building old libraries.
  1.3094 +      build_libtool_libs=no
  1.3095 +      oldlibs="$output"
  1.3096 +      objs="$objs$old_deplibs"
  1.3097 +      ;;
  1.3098 +
  1.3099 +    lib)
  1.3100 +      # Make sure we only generate libraries of the form `libNAME.la'.
  1.3101 +      case $outputname in
  1.3102 +      lib*)
  1.3103 +	name=`$echo "X$outputname" | $Xsed -e 's/\.la$//' -e 's/^lib//'`
  1.3104 +	eval shared_ext=\"$shrext_cmds\"
  1.3105 +	eval libname=\"$libname_spec\"
  1.3106 +	;;
  1.3107 +      *)
  1.3108 +	if test "$module" = no; then
  1.3109 +	  $echo "$modename: libtool library \`$output' must begin with \`lib'" 1>&2
  1.3110 +	  $echo "$help" 1>&2
  1.3111 +	  exit $EXIT_FAILURE
  1.3112 +	fi
  1.3113 +	if test "$need_lib_prefix" != no; then
  1.3114 +	  # Add the "lib" prefix for modules if required
  1.3115 +	  name=`$echo "X$outputname" | $Xsed -e 's/\.la$//'`
  1.3116 +	  eval shared_ext=\"$shrext_cmds\"
  1.3117 +	  eval libname=\"$libname_spec\"
  1.3118 +	else
  1.3119 +	  libname=`$echo "X$outputname" | $Xsed -e 's/\.la$//'`
  1.3120 +	fi
  1.3121 +	;;
  1.3122 +      esac
  1.3123 +
  1.3124 +      if test -n "$objs"; then
  1.3125 +	if test "$deplibs_check_method" != pass_all; then
  1.3126 +	  $echo "$modename: cannot build libtool library \`$output' from non-libtool objects on this host:$objs" 2>&1
  1.3127 +	  exit $EXIT_FAILURE
  1.3128 +	else
  1.3129 +	  $echo
  1.3130 +	  $echo "*** Warning: Linking the shared library $output against the non-libtool"
  1.3131 +	  $echo "*** objects $objs is not portable!"
  1.3132 +	  libobjs="$libobjs $objs"
  1.3133 +	fi
  1.3134 +      fi
  1.3135 +
  1.3136 +      if test "$dlself" != no; then
  1.3137 +	$echo "$modename: warning: \`-dlopen self' is ignored for libtool libraries" 1>&2
  1.3138 +      fi
  1.3139 +
  1.3140 +      set dummy $rpath
  1.3141 +      if test "$#" -gt 2; then
  1.3142 +	$echo "$modename: warning: ignoring multiple \`-rpath's for a libtool library" 1>&2
  1.3143 +      fi
  1.3144 +      install_libdir="$2"
  1.3145 +
  1.3146 +      oldlibs=
  1.3147 +      if test -z "$rpath"; then
  1.3148 +	if test "$build_libtool_libs" = yes; then
  1.3149 +	  # Building a libtool convenience library.
  1.3150 +	  # Some compilers have problems with a `.al' extension so
  1.3151 +	  # convenience libraries should have the same extension an
  1.3152 +	  # archive normally would.
  1.3153 +	  oldlibs="$output_objdir/$libname.$libext $oldlibs"
  1.3154 +	  build_libtool_libs=convenience
  1.3155 +	  build_old_libs=yes
  1.3156 +	fi
  1.3157 +
  1.3158 +	if test -n "$vinfo"; then
  1.3159 +	  $echo "$modename: warning: \`-version-info/-version-number' is ignored for convenience libraries" 1>&2
  1.3160 +	fi
  1.3161 +
  1.3162 +	if test -n "$release"; then
  1.3163 +	  $echo "$modename: warning: \`-release' is ignored for convenience libraries" 1>&2
  1.3164 +	fi
  1.3165 +      else
  1.3166 +
  1.3167 +	# Parse the version information argument.
  1.3168 +	save_ifs="$IFS"; IFS=':'
  1.3169 +	set dummy $vinfo 0 0 0
  1.3170 +	IFS="$save_ifs"
  1.3171 +
  1.3172 +	if test -n "$8"; then
  1.3173 +	  $echo "$modename: too many parameters to \`-version-info'" 1>&2
  1.3174 +	  $echo "$help" 1>&2
  1.3175 +	  exit $EXIT_FAILURE
  1.3176 +	fi
  1.3177 +
  1.3178 +	# convert absolute version numbers to libtool ages
  1.3179 +	# this retains compatibility with .la files and attempts
  1.3180 +	# to make the code below a bit more comprehensible
  1.3181 +
  1.3182 +	case $vinfo_number in
  1.3183 +	yes)
  1.3184 +	  number_major="$2"
  1.3185 +	  number_minor="$3"
  1.3186 +	  number_revision="$4"
  1.3187 +	  #
  1.3188 +	  # There are really only two kinds -- those that
  1.3189 +	  # use the current revision as the major version
  1.3190 +	  # and those that subtract age and use age as
  1.3191 +	  # a minor version.  But, then there is irix
  1.3192 +	  # which has an extra 1 added just for fun
  1.3193 +	  #
  1.3194 +	  case $version_type in
  1.3195 +	  darwin|linux|osf|windows)
  1.3196 +	    current=`expr $number_major + $number_minor`
  1.3197 +	    age="$number_minor"
  1.3198 +	    revision="$number_revision"
  1.3199 +	    ;;
  1.3200 +	  freebsd-aout|freebsd-elf|sunos)
  1.3201 +	    current="$number_major"
  1.3202 +	    revision="$number_minor"
  1.3203 +	    age="0"
  1.3204 +	    ;;
  1.3205 +	  irix|nonstopux)
  1.3206 +	    current=`expr $number_major + $number_minor - 1`
  1.3207 +	    age="$number_minor"
  1.3208 +	    revision="$number_minor"
  1.3209 +	    ;;
  1.3210 +	  *)
  1.3211 +	    $echo "$modename: unknown library version type \`$version_type'" 1>&2
  1.3212 +	    $echo "Fatal configuration error.  See the $PACKAGE docs for more information." 1>&2
  1.3213 +	    exit $EXIT_FAILURE
  1.3214 +	    ;;
  1.3215 +	  esac
  1.3216 +	  ;;
  1.3217 +	no)
  1.3218 +	  current="$2"
  1.3219 +	  revision="$3"
  1.3220 +	  age="$4"
  1.3221 +	  ;;
  1.3222 +	esac
  1.3223 +
  1.3224 +	# Check that each of the things are valid numbers.
  1.3225 +	case $current in
  1.3226 +	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]) ;;
  1.3227 +	*)
  1.3228 +	  $echo "$modename: CURRENT \`$current' must be a nonnegative integer" 1>&2
  1.3229 +	  $echo "$modename: \`$vinfo' is not valid version information" 1>&2
  1.3230 +	  exit $EXIT_FAILURE
  1.3231 +	  ;;
  1.3232 +	esac
  1.3233 +
  1.3234 +	case $revision in
  1.3235 +	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]) ;;
  1.3236 +	*)
  1.3237 +	  $echo "$modename: REVISION \`$revision' must be a nonnegative integer" 1>&2
  1.3238 +	  $echo "$modename: \`$vinfo' is not valid version information" 1>&2
  1.3239 +	  exit $EXIT_FAILURE
  1.3240 +	  ;;
  1.3241 +	esac
  1.3242 +
  1.3243 +	case $age in
  1.3244 +	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]) ;;
  1.3245 +	*)
  1.3246 +	  $echo "$modename: AGE \`$age' must be a nonnegative integer" 1>&2
  1.3247 +	  $echo "$modename: \`$vinfo' is not valid version information" 1>&2
  1.3248 +	  exit $EXIT_FAILURE
  1.3249 +	  ;;
  1.3250 +	esac
  1.3251 +
  1.3252 +	if test "$age" -gt "$current"; then
  1.3253 +	  $echo "$modename: AGE \`$age' is greater than the current interface number \`$current'" 1>&2
  1.3254 +	  $echo "$modename: \`$vinfo' is not valid version information" 1>&2
  1.3255 +	  exit $EXIT_FAILURE
  1.3256 +	fi
  1.3257 +
  1.3258 +	# Calculate the version variables.
  1.3259 +	major=
  1.3260 +	versuffix=
  1.3261 +	verstring=
  1.3262 +	case $version_type in
  1.3263 +	none) ;;
  1.3264 +
  1.3265 +	darwin)
  1.3266 +	  # Like Linux, but with the current version available in
  1.3267 +	  # verstring for coding it into the library header
  1.3268 +	  major=.`expr $current - $age`
  1.3269 +	  versuffix="$major.$age.$revision"
  1.3270 +	  # Darwin ld doesn't like 0 for these options...
  1.3271 +	  minor_current=`expr $current + 1`
  1.3272 +	  verstring="${wl}-compatibility_version ${wl}$minor_current ${wl}-current_version ${wl}$minor_current.$revision"
  1.3273 +	  ;;
  1.3274 +
  1.3275 +	freebsd-aout)
  1.3276 +	  major=".$current"
  1.3277 +	  versuffix=".$current.$revision";
  1.3278 +	  ;;
  1.3279 +
  1.3280 +	freebsd-elf)
  1.3281 +	  major=".$current"
  1.3282 +	  versuffix=".$current";
  1.3283 +	  ;;
  1.3284 +
  1.3285 +	irix | nonstopux)
  1.3286 +	  major=`expr $current - $age + 1`
  1.3287 +
  1.3288 +	  case $version_type in
  1.3289 +	    nonstopux) verstring_prefix=nonstopux ;;
  1.3290 +	    *)         verstring_prefix=sgi ;;
  1.3291 +	  esac
  1.3292 +	  verstring="$verstring_prefix$major.$revision"
  1.3293 +
  1.3294 +	  # Add in all the interfaces that we are compatible with.
  1.3295 +	  loop=$revision
  1.3296 +	  while test "$loop" -ne 0; do
  1.3297 +	    iface=`expr $revision - $loop`
  1.3298 +	    loop=`expr $loop - 1`
  1.3299 +	    verstring="$verstring_prefix$major.$iface:$verstring"
  1.3300 +	  done
  1.3301 +
  1.3302 +	  # Before this point, $major must not contain `.'.
  1.3303 +	  major=.$major
  1.3304 +	  versuffix="$major.$revision"
  1.3305 +	  ;;
  1.3306 +
  1.3307 +	linux)
  1.3308 +	  major=.`expr $current - $age`
  1.3309 +	  versuffix="$major.$age.$revision"
  1.3310 +	  ;;
  1.3311 +
  1.3312 +	osf)
  1.3313 +	  major=.`expr $current - $age`
  1.3314 +	  versuffix=".$current.$age.$revision"
  1.3315 +	  verstring="$current.$age.$revision"
  1.3316 +
  1.3317 +	  # Add in all the interfaces that we are compatible with.
  1.3318 +	  loop=$age
  1.3319 +	  while test "$loop" -ne 0; do
  1.3320 +	    iface=`expr $current - $loop`
  1.3321 +	    loop=`expr $loop - 1`
  1.3322 +	    verstring="$verstring:${iface}.0"
  1.3323 +	  done
  1.3324 +
  1.3325 +	  # Make executables depend on our current version.
  1.3326 +	  verstring="$verstring:${current}.0"
  1.3327 +	  ;;
  1.3328 +
  1.3329 +	sunos)
  1.3330 +	  major=".$current"
  1.3331 +	  versuffix=".$current.$revision"
  1.3332 +	  ;;
  1.3333 +
  1.3334 +	windows)
  1.3335 +	  # Use '-' rather than '.', since we only want one
  1.3336 +	  # extension on DOS 8.3 filesystems.
  1.3337 +	  major=`expr $current - $age`
  1.3338 +	  versuffix="-$major"
  1.3339 +	  ;;
  1.3340 +
  1.3341 +	*)
  1.3342 +	  $echo "$modename: unknown library version type \`$version_type'" 1>&2
  1.3343 +	  $echo "Fatal configuration error.  See the $PACKAGE docs for more information." 1>&2
  1.3344 +	  exit $EXIT_FAILURE
  1.3345 +	  ;;
  1.3346 +	esac
  1.3347 +
  1.3348 +	# Clear the version info if we defaulted, and they specified a release.
  1.3349 +	if test -z "$vinfo" && test -n "$release"; then
  1.3350 +	  major=
  1.3351 +	  case $version_type in
  1.3352 +	  darwin)
  1.3353 +	    # we can't check for "0.0" in archive_cmds due to quoting
  1.3354 +	    # problems, so we reset it completely
  1.3355 +	    verstring=
  1.3356 +	    ;;
  1.3357 +	  *)
  1.3358 +	    verstring="0.0"
  1.3359 +	    ;;
  1.3360 +	  esac
  1.3361 +	  if test "$need_version" = no; then
  1.3362 +	    versuffix=
  1.3363 +	  else
  1.3364 +	    versuffix=".0.0"
  1.3365 +	  fi
  1.3366 +	fi
  1.3367 +
  1.3368 +	# Remove version info from name if versioning should be avoided
  1.3369 +	if test "$avoid_version" = yes && test "$need_version" = no; then
  1.3370 +	  major=
  1.3371 +	  versuffix=
  1.3372 +	  verstring=""
  1.3373 +	fi
  1.3374 +
  1.3375 +	# Check to see if the archive will have undefined symbols.
  1.3376 +	if test "$allow_undefined" = yes; then
  1.3377 +	  if test "$allow_undefined_flag" = unsupported; then
  1.3378 +	    $echo "$modename: warning: undefined symbols not allowed in $host shared libraries" 1>&2
  1.3379 +	    build_libtool_libs=no
  1.3380 +	    build_old_libs=yes
  1.3381 +	  fi
  1.3382 +	else
  1.3383 +	  # Don't allow undefined symbols.
  1.3384 +	  allow_undefined_flag="$no_undefined_flag"
  1.3385 +	fi
  1.3386 +      fi
  1.3387 +
  1.3388 +      if test "$mode" != relink; then
  1.3389 +	# Remove our outputs, but don't remove object files since they
  1.3390 +	# may have been created when compiling PIC objects.
  1.3391 +	removelist=
  1.3392 +	tempremovelist=`$echo "$output_objdir/*"`
  1.3393 +	for p in $tempremovelist; do
  1.3394 +	  case $p in
  1.3395 +	    *.$objext)
  1.3396 +	       ;;
  1.3397 +	    $output_objdir/$outputname | $output_objdir/$libname.* | $output_objdir/${libname}${release}.*)
  1.3398 +	       if test "X$precious_files_regex" != "X"; then
  1.3399 +	         if echo $p | $EGREP -e "$precious_files_regex" >/dev/null 2>&1
  1.3400 +	         then
  1.3401 +		   continue
  1.3402 +		 fi
  1.3403 +	       fi
  1.3404 +	       removelist="$removelist $p"
  1.3405 +	       ;;
  1.3406 +	    *) ;;
  1.3407 +	  esac
  1.3408 +	done
  1.3409 +	if test -n "$removelist"; then
  1.3410 +	  $show "${rm}r $removelist"
  1.3411 +	  $run ${rm}r $removelist
  1.3412 +	fi
  1.3413 +      fi
  1.3414 +
  1.3415 +      # Now set the variables for building old libraries.
  1.3416 +      if test "$build_old_libs" = yes && test "$build_libtool_libs" != convenience ; then
  1.3417 +	oldlibs="$oldlibs $output_objdir/$libname.$libext"
  1.3418 +
  1.3419 +	# Transform .lo files to .o files.
  1.3420 +	oldobjs="$objs "`$echo "X$libobjs" | $SP2NL | $Xsed -e '/\.'${libext}'$/d' -e "$lo2o" | $NL2SP`
  1.3421 +      fi
  1.3422 +
  1.3423 +      # Eliminate all temporary directories.
  1.3424 +      for path in $notinst_path; do
  1.3425 +	lib_search_path=`$echo "$lib_search_path " | ${SED} -e "s% $path % %g"`
  1.3426 +	deplibs=`$echo "$deplibs " | ${SED} -e "s% -L$path % %g"`
  1.3427 +	dependency_libs=`$echo "$dependency_libs " | ${SED} -e "s% -L$path % %g"`
  1.3428 +      done
  1.3429 +
  1.3430 +      if test -n "$xrpath"; then
  1.3431 +	# If the user specified any rpath flags, then add them.
  1.3432 +	temp_xrpath=
  1.3433 +	for libdir in $xrpath; do
  1.3434 +	  temp_xrpath="$temp_xrpath -R$libdir"
  1.3435 +	  case "$finalize_rpath " in
  1.3436 +	  *" $libdir "*) ;;
  1.3437 +	  *) finalize_rpath="$finalize_rpath $libdir" ;;
  1.3438 +	  esac
  1.3439 +	done
  1.3440 +	if test "$hardcode_into_libs" != yes || test "$build_old_libs" = yes; then
  1.3441 +	  dependency_libs="$temp_xrpath $dependency_libs"
  1.3442 +	fi
  1.3443 +      fi
  1.3444 +
  1.3445 +      # Make sure dlfiles contains only unique files that won't be dlpreopened
  1.3446 +      old_dlfiles="$dlfiles"
  1.3447 +      dlfiles=
  1.3448 +      for lib in $old_dlfiles; do
  1.3449 +	case " $dlprefiles $dlfiles " in
  1.3450 +	*" $lib "*) ;;
  1.3451 +	*) dlfiles="$dlfiles $lib" ;;
  1.3452 +	esac
  1.3453 +      done
  1.3454 +
  1.3455 +      # Make sure dlprefiles contains only unique files
  1.3456 +      old_dlprefiles="$dlprefiles"
  1.3457 +      dlprefiles=
  1.3458 +      for lib in $old_dlprefiles; do
  1.3459 +	case "$dlprefiles " in
  1.3460 +	*" $lib "*) ;;
  1.3461 +	*) dlprefiles="$dlprefiles $lib" ;;
  1.3462 +	esac
  1.3463 +      done
  1.3464 +
  1.3465 +      if test "$build_libtool_libs" = yes; then
  1.3466 +	if test -n "$rpath"; then
  1.3467 +	  case $host in
  1.3468 +	  *-*-cygwin* | *-*-mingw* | *-*-pw32* | *-*-os2* | *-*-beos*)
  1.3469 +	    # these systems don't actually have a c library (as such)!
  1.3470 +	    ;;
  1.3471 +	  *-*-rhapsody* | *-*-darwin1.[012])
  1.3472 +	    # Rhapsody C library is in the System framework
  1.3473 +	    deplibs="$deplibs -framework System"
  1.3474 +	    ;;
  1.3475 +	  *-*-netbsd*)
  1.3476 +	    # Don't link with libc until the a.out ld.so is fixed.
  1.3477 +	    ;;
  1.3478 +	  *-*-openbsd* | *-*-freebsd* | *-*-dragonfly*)
  1.3479 +	    # Do not include libc due to us having libc/libc_r.
  1.3480 +	    ;;
  1.3481 +	  *-*-sco3.2v5* | *-*-sco5v6*)
  1.3482 +	    # Causes problems with __ctype
  1.3483 +	    ;;
  1.3484 +	  *-*-sysv4.2uw2* | *-*-sysv5* | *-*-unixware* | *-*-OpenUNIX*)
  1.3485 +	    # Compiler inserts libc in the correct place for threads to work
  1.3486 +	    ;;
  1.3487 + 	  *)
  1.3488 +	    # Add libc to deplibs on all other systems if necessary.
  1.3489 +	    if test "$build_libtool_need_lc" = "yes"; then
  1.3490 +	      deplibs="$deplibs -lc"
  1.3491 +	    fi
  1.3492 +	    ;;
  1.3493 +	  esac
  1.3494 +	fi
  1.3495 +
  1.3496 +	# Transform deplibs into only deplibs that can be linked in shared.
  1.3497 +	name_save=$name
  1.3498 +	libname_save=$libname
  1.3499 +	release_save=$release
  1.3500 +	versuffix_save=$versuffix
  1.3501 +	major_save=$major
  1.3502 +	# I'm not sure if I'm treating the release correctly.  I think
  1.3503 +	# release should show up in the -l (ie -lgmp5) so we don't want to
  1.3504 +	# add it in twice.  Is that correct?
  1.3505 +	release=""
  1.3506 +	versuffix=""
  1.3507 +	major=""
  1.3508 +	newdeplibs=
  1.3509 +	droppeddeps=no
  1.3510 +	case $deplibs_check_method in
  1.3511 +	pass_all)
  1.3512 +	  # Don't check for shared/static.  Everything works.
  1.3513 +	  # This might be a little naive.  We might want to check
  1.3514 +	  # whether the library exists or not.  But this is on
  1.3515 +	  # osf3 & osf4 and I'm not really sure... Just
  1.3516 +	  # implementing what was already the behavior.
  1.3517 +	  newdeplibs=$deplibs
  1.3518 +	  ;;
  1.3519 +	test_compile)
  1.3520 +	  # This code stresses the "libraries are programs" paradigm to its
  1.3521 +	  # limits. Maybe even breaks it.  We compile a program, linking it
  1.3522 +	  # against the deplibs as a proxy for the library.  Then we can check
  1.3523 +	  # whether they linked in statically or dynamically with ldd.
  1.3524 +	  $rm conftest.c
  1.3525 +	  cat > conftest.c <<EOF
  1.3526 +	  int main() { return 0; }
  1.3527 +EOF
  1.3528 +	  $rm conftest
  1.3529 +	  $LTCC $LTCFLAGS -o conftest conftest.c $deplibs
  1.3530 +	  if test "$?" -eq 0 ; then
  1.3531 +	    ldd_output=`ldd conftest`
  1.3532 +	    for i in $deplibs; do
  1.3533 +	      name=`expr $i : '-l\(.*\)'`
  1.3534 +	      # If $name is empty we are operating on a -L argument.
  1.3535 +              if test "$name" != "" && test "$name" -ne "0"; then
  1.3536 +		if test "X$allow_libtool_libs_with_static_runtimes" = "Xyes" ; then
  1.3537 +		  case " $predeps $postdeps " in
  1.3538 +		  *" $i "*)
  1.3539 +		    newdeplibs="$newdeplibs $i"
  1.3540 +		    i=""
  1.3541 +		    ;;
  1.3542 +		  esac
  1.3543 +	        fi
  1.3544 +		if test -n "$i" ; then
  1.3545 +		  libname=`eval \\$echo \"$libname_spec\"`
  1.3546 +		  deplib_matches=`eval \\$echo \"$library_names_spec\"`
  1.3547 +		  set dummy $deplib_matches
  1.3548 +		  deplib_match=$2
  1.3549 +		  if test `expr "$ldd_output" : ".*$deplib_match"` -ne 0 ; then
  1.3550 +		    newdeplibs="$newdeplibs $i"
  1.3551 +		  else
  1.3552 +		    droppeddeps=yes
  1.3553 +		    $echo
  1.3554 +		    $echo "*** Warning: dynamic linker does not accept needed library $i."
  1.3555 +		    $echo "*** I have the capability to make that library automatically link in when"
  1.3556 +		    $echo "*** you link to this library.  But I can only do this if you have a"
  1.3557 +		    $echo "*** shared version of the library, which I believe you do not have"
  1.3558 +		    $echo "*** because a test_compile did reveal that the linker did not use it for"
  1.3559 +		    $echo "*** its dynamic dependency list that programs get resolved with at runtime."
  1.3560 +		  fi
  1.3561 +		fi
  1.3562 +	      else
  1.3563 +		newdeplibs="$newdeplibs $i"
  1.3564 +	      fi
  1.3565 +	    done
  1.3566 +	  else
  1.3567 +	    # Error occurred in the first compile.  Let's try to salvage
  1.3568 +	    # the situation: Compile a separate program for each library.
  1.3569 +	    for i in $deplibs; do
  1.3570 +	      name=`expr $i : '-l\(.*\)'`
  1.3571 +	      # If $name is empty we are operating on a -L argument.
  1.3572 +              if test "$name" != "" && test "$name" != "0"; then
  1.3573 +		$rm conftest
  1.3574 +		$LTCC $LTCFLAGS -o conftest conftest.c $i
  1.3575 +		# Did it work?
  1.3576 +		if test "$?" -eq 0 ; then
  1.3577 +		  ldd_output=`ldd conftest`
  1.3578 +		  if test "X$allow_libtool_libs_with_static_runtimes" = "Xyes" ; then
  1.3579 +		    case " $predeps $postdeps " in
  1.3580 +		    *" $i "*)
  1.3581 +		      newdeplibs="$newdeplibs $i"
  1.3582 +		      i=""
  1.3583 +		      ;;
  1.3584 +		    esac
  1.3585 +		  fi
  1.3586 +		  if test -n "$i" ; then
  1.3587 +		    libname=`eval \\$echo \"$libname_spec\"`
  1.3588 +		    deplib_matches=`eval \\$echo \"$library_names_spec\"`
  1.3589 +		    set dummy $deplib_matches
  1.3590 +		    deplib_match=$2
  1.3591 +		    if test `expr "$ldd_output" : ".*$deplib_match"` -ne 0 ; then
  1.3592 +		      newdeplibs="$newdeplibs $i"
  1.3593 +		    else
  1.3594 +		      droppeddeps=yes
  1.3595 +		      $echo
  1.3596 +		      $echo "*** Warning: dynamic linker does not accept needed library $i."
  1.3597 +		      $echo "*** I have the capability to make that library automatically link in when"
  1.3598 +		      $echo "*** you link to this library.  But I can only do this if you have a"
  1.3599 +		      $echo "*** shared version of the library, which you do not appear to have"
  1.3600 +		      $echo "*** because a test_compile did reveal that the linker did not use this one"
  1.3601 +		      $echo "*** as a dynamic dependency that programs can get resolved with at runtime."
  1.3602 +		    fi
  1.3603 +		  fi
  1.3604 +		else
  1.3605 +		  droppeddeps=yes
  1.3606 +		  $echo
  1.3607 +		  $echo "*** Warning!  Library $i is needed by this library but I was not able to"
  1.3608 +		  $echo "***  make it link in!  You will probably need to install it or some"
  1.3609 +		  $echo "*** library that it depends on before this library will be fully"
  1.3610 +		  $echo "*** functional.  Installing it before continuing would be even better."
  1.3611 +		fi
  1.3612 +	      else
  1.3613 +		newdeplibs="$newdeplibs $i"
  1.3614 +	      fi
  1.3615 +	    done
  1.3616 +	  fi
  1.3617 +	  ;;
  1.3618 +	file_magic*)
  1.3619 +	  set dummy $deplibs_check_method
  1.3620 +	  file_magic_regex=`expr "$deplibs_check_method" : "$2 \(.*\)"`
  1.3621 +	  for a_deplib in $deplibs; do
  1.3622 +	    name=`expr $a_deplib : '-l\(.*\)'`
  1.3623 +	    # If $name is empty we are operating on a -L argument.
  1.3624 +            if test "$name" != "" && test  "$name" != "0"; then
  1.3625 +	      if test "X$allow_libtool_libs_with_static_runtimes" = "Xyes" ; then
  1.3626 +		case " $predeps $postdeps " in
  1.3627 +		*" $a_deplib "*)
  1.3628 +		  newdeplibs="$newdeplibs $a_deplib"
  1.3629 +		  a_deplib=""
  1.3630 +		  ;;
  1.3631 +		esac
  1.3632 +	      fi
  1.3633 +	      if test -n "$a_deplib" ; then
  1.3634 +		libname=`eval \\$echo \"$libname_spec\"`
  1.3635 +		for i in $lib_search_path $sys_lib_search_path $shlib_search_path; do
  1.3636 +		  potential_libs=`ls $i/$libname[.-]* 2>/dev/null`
  1.3637 +		  for potent_lib in $potential_libs; do
  1.3638 +		      # Follow soft links.
  1.3639 +		      if ls -lLd "$potent_lib" 2>/dev/null \
  1.3640 +			 | grep " -> " >/dev/null; then
  1.3641 +			continue
  1.3642 +		      fi
  1.3643 +		      # The statement above tries to avoid entering an
  1.3644 +		      # endless loop below, in case of cyclic links.
  1.3645 +		      # We might still enter an endless loop, since a link
  1.3646 +		      # loop can be closed while we follow links,
  1.3647 +		      # but so what?
  1.3648 +		      potlib="$potent_lib"
  1.3649 +		      while test -h "$potlib" 2>/dev/null; do
  1.3650 +			potliblink=`ls -ld $potlib | ${SED} 's/.* -> //'`
  1.3651 +			case $potliblink in
  1.3652 +			[\\/]* | [A-Za-z]:[\\/]*) potlib="$potliblink";;
  1.3653 +			*) potlib=`$echo "X$potlib" | $Xsed -e 's,[^/]*$,,'`"$potliblink";;
  1.3654 +			esac
  1.3655 +		      done
  1.3656 +		      if eval $file_magic_cmd \"\$potlib\" 2>/dev/null \
  1.3657 +			 | ${SED} 10q \
  1.3658 +			 | $EGREP "$file_magic_regex" > /dev/null; then
  1.3659 +			newdeplibs="$newdeplibs $a_deplib"
  1.3660 +			a_deplib=""
  1.3661 +			break 2
  1.3662 +		      fi
  1.3663 +		  done
  1.3664 +		done
  1.3665 +	      fi
  1.3666 +	      if test -n "$a_deplib" ; then
  1.3667 +		droppeddeps=yes
  1.3668 +		$echo
  1.3669 +		$echo "*** Warning: linker path does not have real file for library $a_deplib."
  1.3670 +		$echo "*** I have the capability to make that library automatically link in when"
  1.3671 +		$echo "*** you link to this library.  But I can only do this if you have a"
  1.3672 +		$echo "*** shared version of the library, which you do not appear to have"
  1.3673 +		$echo "*** because I did check the linker path looking for a file starting"
  1.3674 +		if test -z "$potlib" ; then
  1.3675 +		  $echo "*** with $libname but no candidates were found. (...for file magic test)"
  1.3676 +		else
  1.3677 +		  $echo "*** with $libname and none of the candidates passed a file format test"
  1.3678 +		  $echo "*** using a file magic. Last file checked: $potlib"
  1.3679 +		fi
  1.3680 +	      fi
  1.3681 +	    else
  1.3682 +	      # Add a -L argument.
  1.3683 +	      newdeplibs="$newdeplibs $a_deplib"
  1.3684 +	    fi
  1.3685 +	  done # Gone through all deplibs.
  1.3686 +	  ;;
  1.3687 +	match_pattern*)
  1.3688 +	  set dummy $deplibs_check_method
  1.3689 +	  match_pattern_regex=`expr "$deplibs_check_method" : "$2 \(.*\)"`
  1.3690 +	  for a_deplib in $deplibs; do
  1.3691 +	    name=`expr $a_deplib : '-l\(.*\)'`
  1.3692 +	    # If $name is empty we are operating on a -L argument.
  1.3693 +	    if test -n "$name" && test "$name" != "0"; then
  1.3694 +	      if test "X$allow_libtool_libs_with_static_runtimes" = "Xyes" ; then
  1.3695 +		case " $predeps $postdeps " in
  1.3696 +		*" $a_deplib "*)
  1.3697 +		  newdeplibs="$newdeplibs $a_deplib"
  1.3698 +		  a_deplib=""
  1.3699 +		  ;;
  1.3700 +		esac
  1.3701 +	      fi
  1.3702 +	      if test -n "$a_deplib" ; then
  1.3703 +		libname=`eval \\$echo \"$libname_spec\"`
  1.3704 +		for i in $lib_search_path $sys_lib_search_path $shlib_search_path; do
  1.3705 +		  potential_libs=`ls $i/$libname[.-]* 2>/dev/null`
  1.3706 +		  for potent_lib in $potential_libs; do
  1.3707 +		    potlib="$potent_lib" # see symlink-check above in file_magic test
  1.3708 +		    if eval $echo \"$potent_lib\" 2>/dev/null \
  1.3709 +		        | ${SED} 10q \
  1.3710 +		        | $EGREP "$match_pattern_regex" > /dev/null; then
  1.3711 +		      newdeplibs="$newdeplibs $a_deplib"
  1.3712 +		      a_deplib=""
  1.3713 +		      break 2
  1.3714 +		    fi
  1.3715 +		  done
  1.3716 +		done
  1.3717 +	      fi
  1.3718 +	      if test -n "$a_deplib" ; then
  1.3719 +		droppeddeps=yes
  1.3720 +		$echo
  1.3721 +		$echo "*** Warning: linker path does not have real file for library $a_deplib."
  1.3722 +		$echo "*** I have the capability to make that library automatically link in when"
  1.3723 +		$echo "*** you link to this library.  But I can only do this if you have a"
  1.3724 +		$echo "*** shared version of the library, which you do not appear to have"
  1.3725 +		$echo "*** because I did check the linker path looking for a file starting"
  1.3726 +		if test -z "$potlib" ; then
  1.3727 +		  $echo "*** with $libname but no candidates were found. (...for regex pattern test)"
  1.3728 +		else
  1.3729 +		  $echo "*** with $libname and none of the candidates passed a file format test"
  1.3730 +		  $echo "*** using a regex pattern. Last file checked: $potlib"
  1.3731 +		fi
  1.3732 +	      fi
  1.3733 +	    else
  1.3734 +	      # Add a -L argument.
  1.3735 +	      newdeplibs="$newdeplibs $a_deplib"
  1.3736 +	    fi
  1.3737 +	  done # Gone through all deplibs.
  1.3738 +	  ;;
  1.3739 +	none | unknown | *)
  1.3740 +	  newdeplibs=""
  1.3741 +	  tmp_deplibs=`$echo "X $deplibs" | $Xsed -e 's/ -lc$//' \
  1.3742 +	    -e 's/ -[LR][^ ]*//g'`
  1.3743 +	  if test "X$allow_libtool_libs_with_static_runtimes" = "Xyes" ; then
  1.3744 +	    for i in $predeps $postdeps ; do
  1.3745 +	      # can't use Xsed below, because $i might contain '/'
  1.3746 +	      tmp_deplibs=`$echo "X $tmp_deplibs" | ${SED} -e "1s,^X,," -e "s,$i,,"`
  1.3747 +	    done
  1.3748 +	  fi
  1.3749 +	  if $echo "X $tmp_deplibs" | $Xsed -e 's/[ 	]//g' \
  1.3750 +	    | grep . >/dev/null; then
  1.3751 +	    $echo
  1.3752 +	    if test "X$deplibs_check_method" = "Xnone"; then
  1.3753 +	      $echo "*** Warning: inter-library dependencies are not supported in this platform."
  1.3754 +	    else
  1.3755 +	      $echo "*** Warning: inter-library dependencies are not known to be supported."
  1.3756 +	    fi
  1.3757 +	    $echo "*** All declared inter-library dependencies are being dropped."
  1.3758 +	    droppeddeps=yes
  1.3759 +	  fi
  1.3760 +	  ;;
  1.3761 +	esac
  1.3762 +	versuffix=$versuffix_save
  1.3763 +	major=$major_save
  1.3764 +	release=$release_save
  1.3765 +	libname=$libname_save
  1.3766 +	name=$name_save
  1.3767 +
  1.3768 +	case $host in
  1.3769 +	*-*-rhapsody* | *-*-darwin1.[012])
  1.3770 +	  # On Rhapsody replace the C library is the System framework
  1.3771 +	  newdeplibs=`$echo "X $newdeplibs" | $Xsed -e 's/ -lc / -framework System /'`
  1.3772 +	  ;;
  1.3773 +	esac
  1.3774 +
  1.3775 +	if test "$droppeddeps" = yes; then
  1.3776 +	  if test "$module" = yes; then
  1.3777 +	    $echo
  1.3778 +	    $echo "*** Warning: libtool could not satisfy all declared inter-library"
  1.3779 +	    $echo "*** dependencies of module $libname.  Therefore, libtool will create"
  1.3780 +	    $echo "*** a static module, that should work as long as the dlopening"
  1.3781 +	    $echo "*** application is linked with the -dlopen flag."
  1.3782 +	    if test -z "$global_symbol_pipe"; then
  1.3783 +	      $echo
  1.3784 +	      $echo "*** However, this would only work if libtool was able to extract symbol"
  1.3785 +	      $echo "*** lists from a program, using \`nm' or equivalent, but libtool could"
  1.3786 +	      $echo "*** not find such a program.  So, this module is probably useless."
  1.3787 +	      $echo "*** \`nm' from GNU binutils and a full rebuild may help."
  1.3788 +	    fi
  1.3789 +	    if test "$build_old_libs" = no; then
  1.3790 +	      oldlibs="$output_objdir/$libname.$libext"
  1.3791 +	      build_libtool_libs=module
  1.3792 +	      build_old_libs=yes
  1.3793 +	    else
  1.3794 +	      build_libtool_libs=no
  1.3795 +	    fi
  1.3796 +	  else
  1.3797 +	    $echo "*** The inter-library dependencies that have been dropped here will be"
  1.3798 +	    $echo "*** automatically added whenever a program is linked with this library"
  1.3799 +	    $echo "*** or is declared to -dlopen it."
  1.3800 +
  1.3801 +	    if test "$allow_undefined" = no; then
  1.3802 +	      $echo
  1.3803 +	      $echo "*** Since this library must not contain undefined symbols,"
  1.3804 +	      $echo "*** because either the platform does not support them or"
  1.3805 +	      $echo "*** it was explicitly requested with -no-undefined,"
  1.3806 +	      $echo "*** libtool will only create a static version of it."
  1.3807 +	      if test "$build_old_libs" = no; then
  1.3808 +		oldlibs="$output_objdir/$libname.$libext"
  1.3809 +		build_libtool_libs=module
  1.3810 +		build_old_libs=yes
  1.3811 +	      else
  1.3812 +		build_libtool_libs=no
  1.3813 +	      fi
  1.3814 +	    fi
  1.3815 +	  fi
  1.3816 +	fi
  1.3817 +	# Done checking deplibs!
  1.3818 +	deplibs=$newdeplibs
  1.3819 +      fi
  1.3820 +
  1.3821 +
  1.3822 +      # move library search paths that coincide with paths to not yet
  1.3823 +      # installed libraries to the beginning of the library search list
  1.3824 +      new_libs=
  1.3825 +      for path in $notinst_path; do
  1.3826 +	case " $new_libs " in
  1.3827 +	*" -L$path/$objdir "*) ;;
  1.3828 +	*)
  1.3829 +	  case " $deplibs " in
  1.3830 +	  *" -L$path/$objdir "*)
  1.3831 +	    new_libs="$new_libs -L$path/$objdir" ;;
  1.3832 +	  esac
  1.3833 +	  ;;
  1.3834 +	esac
  1.3835 +      done
  1.3836 +      for deplib in $deplibs; do
  1.3837 +	case $deplib in
  1.3838 +	-L*)
  1.3839 +	  case " $new_libs " in
  1.3840 +	  *" $deplib "*) ;;
  1.3841 +	  *) new_libs="$new_libs $deplib" ;;
  1.3842 +	  esac
  1.3843 +	  ;;
  1.3844 +	*) new_libs="$new_libs $deplib" ;;
  1.3845 +	esac
  1.3846 +      done
  1.3847 +      deplibs="$new_libs"
  1.3848 +
  1.3849 +
  1.3850 +      # All the library-specific variables (install_libdir is set above).
  1.3851 +      library_names=
  1.3852 +      old_library=
  1.3853 +      dlname=
  1.3854 +
  1.3855 +      # Test again, we may have decided not to build it any more
  1.3856 +      if test "$build_libtool_libs" = yes; then
  1.3857 +	if test "$hardcode_into_libs" = yes; then
  1.3858 +	  # Hardcode the library paths
  1.3859 +	  hardcode_libdirs=
  1.3860 +	  dep_rpath=
  1.3861 +	  rpath="$finalize_rpath"
  1.3862 +	  test "$mode" != relink && rpath="$compile_rpath$rpath"
  1.3863 +	  for libdir in $rpath; do
  1.3864 +	    if test -n "$hardcode_libdir_flag_spec"; then
  1.3865 +	      if test -n "$hardcode_libdir_separator"; then
  1.3866 +		if test -z "$hardcode_libdirs"; then
  1.3867 +		  hardcode_libdirs="$libdir"
  1.3868 +		else
  1.3869 +		  # Just accumulate the unique libdirs.
  1.3870 +		  case $hardcode_libdir_separator$hardcode_libdirs$hardcode_libdir_separator in
  1.3871 +		  *"$hardcode_libdir_separator$libdir$hardcode_libdir_separator"*)
  1.3872 +		    ;;
  1.3873 +		  *)
  1.3874 +		    hardcode_libdirs="$hardcode_libdirs$hardcode_libdir_separator$libdir"
  1.3875 +		    ;;
  1.3876 +		  esac
  1.3877 +		fi
  1.3878 +	      else
  1.3879 +		eval flag=\"$hardcode_libdir_flag_spec\"
  1.3880 +		dep_rpath="$dep_rpath $flag"
  1.3881 +	      fi
  1.3882 +	    elif test -n "$runpath_var"; then
  1.3883 +	      case "$perm_rpath " in
  1.3884 +	      *" $libdir "*) ;;
  1.3885 +	      *) perm_rpath="$perm_rpath $libdir" ;;
  1.3886 +	      esac
  1.3887 +	    fi
  1.3888 +	  done
  1.3889 +	  # Substitute the hardcoded libdirs into the rpath.
  1.3890 +	  if test -n "$hardcode_libdir_separator" &&
  1.3891 +	     test -n "$hardcode_libdirs"; then
  1.3892 +	    libdir="$hardcode_libdirs"
  1.3893 +	    if test -n "$hardcode_libdir_flag_spec_ld"; then
  1.3894 +	      eval dep_rpath=\"$hardcode_libdir_flag_spec_ld\"
  1.3895 +	    else
  1.3896 +	      eval dep_rpath=\"$hardcode_libdir_flag_spec\"
  1.3897 +	    fi
  1.3898 +	  fi
  1.3899 +	  if test -n "$runpath_var" && test -n "$perm_rpath"; then
  1.3900 +	    # We should set the runpath_var.
  1.3901 +	    rpath=
  1.3902 +	    for dir in $perm_rpath; do
  1.3903 +	      rpath="$rpath$dir:"
  1.3904 +	    done
  1.3905 +	    eval "$runpath_var='$rpath\$$runpath_var'; export $runpath_var"
  1.3906 +	  fi
  1.3907 +	  test -n "$dep_rpath" && deplibs="$dep_rpath $deplibs"
  1.3908 +	fi
  1.3909 +
  1.3910 +	shlibpath="$finalize_shlibpath"
  1.3911 +	test "$mode" != relink && shlibpath="$compile_shlibpath$shlibpath"
  1.3912 +	if test -n "$shlibpath"; then
  1.3913 +	  eval "$shlibpath_var='$shlibpath\$$shlibpath_var'; export $shlibpath_var"
  1.3914 +	fi
  1.3915 +
  1.3916 +	# Get the real and link names of the library.
  1.3917 +	eval shared_ext=\"$shrext_cmds\"
  1.3918 +	eval library_names=\"$library_names_spec\"
  1.3919 +	set dummy $library_names
  1.3920 +	realname="$2"
  1.3921 +	shift; shift
  1.3922 +
  1.3923 +	if test -n "$soname_spec"; then
  1.3924 +	  eval soname=\"$soname_spec\"
  1.3925 +	else
  1.3926 +	  soname="$realname"
  1.3927 +	fi
  1.3928 +	if test -z "$dlname"; then
  1.3929 +	  dlname=$soname
  1.3930 +	fi
  1.3931 +
  1.3932 +	lib="$output_objdir/$realname"
  1.3933 +	linknames=
  1.3934 +	for link
  1.3935 +	do
  1.3936 +	  linknames="$linknames $link"
  1.3937 +	done
  1.3938 +
  1.3939 +	# Use standard objects if they are pic
  1.3940 +	test -z "$pic_flag" && libobjs=`$echo "X$libobjs" | $SP2NL | $Xsed -e "$lo2o" | $NL2SP`
  1.3941 +
  1.3942 +	# Prepare the list of exported symbols
  1.3943 +	if test -z "$export_symbols"; then
  1.3944 +	  if test "$always_export_symbols" = yes || test -n "$export_symbols_regex"; then
  1.3945 +	    $show "generating symbol list for \`$libname.la'"
  1.3946 +	    export_symbols="$output_objdir/$libname.exp"
  1.3947 +	    $run $rm $export_symbols
  1.3948 +	    cmds=$export_symbols_cmds
  1.3949 +	    save_ifs="$IFS"; IFS='~'
  1.3950 +	    for cmd in $cmds; do
  1.3951 +	      IFS="$save_ifs"
  1.3952 +	      eval cmd=\"$cmd\"
  1.3953 +	      if len=`expr "X$cmd" : ".*"` &&
  1.3954 +	       test "$len" -le "$max_cmd_len" || test "$max_cmd_len" -le -1; then
  1.3955 +	        $show "$cmd"
  1.3956 +	        $run eval "$cmd" || exit $?
  1.3957 +	        skipped_export=false
  1.3958 +	      else
  1.3959 +	        # The command line is too long to execute in one step.
  1.3960 +	        $show "using reloadable object file for export list..."
  1.3961 +	        skipped_export=:
  1.3962 +		# Break out early, otherwise skipped_export may be
  1.3963 +		# set to false by a later but shorter cmd.
  1.3964 +		break
  1.3965 +	      fi
  1.3966 +	    done
  1.3967 +	    IFS="$save_ifs"
  1.3968 +	    if test -n "$export_symbols_regex"; then
  1.3969 +	      $show "$EGREP -e \"$export_symbols_regex\" \"$export_symbols\" > \"${export_symbols}T\""
  1.3970 +	      $run eval '$EGREP -e "$export_symbols_regex" "$export_symbols" > "${export_symbols}T"'
  1.3971 +	      $show "$mv \"${export_symbols}T\" \"$export_symbols\""
  1.3972 +	      $run eval '$mv "${export_symbols}T" "$export_symbols"'
  1.3973 +	    fi
  1.3974 +	  fi
  1.3975 +	fi
  1.3976 +
  1.3977 +	if test -n "$export_symbols" && test -n "$include_expsyms"; then
  1.3978 +	  $run eval '$echo "X$include_expsyms" | $SP2NL >> "$export_symbols"'
  1.3979 +	fi
  1.3980 +
  1.3981 +	tmp_deplibs=
  1.3982 +	for test_deplib in $deplibs; do
  1.3983 +		case " $convenience " in
  1.3984 +		*" $test_deplib "*) ;;
  1.3985 +		*)
  1.3986 +			tmp_deplibs="$tmp_deplibs $test_deplib"
  1.3987 +			;;
  1.3988 +		esac
  1.3989 +	done
  1.3990 +	deplibs="$tmp_deplibs"
  1.3991 +
  1.3992 +	if test -n "$convenience"; then
  1.3993 +	  if test -n "$whole_archive_flag_spec"; then
  1.3994 +	    save_libobjs=$libobjs
  1.3995 +	    eval libobjs=\"\$libobjs $whole_archive_flag_spec\"
  1.3996 +	  else
  1.3997 +	    gentop="$output_objdir/${outputname}x"
  1.3998 +	    generated="$generated $gentop"
  1.3999 +
  1.4000 +	    func_extract_archives $gentop $convenience
  1.4001 +	    libobjs="$libobjs $func_extract_archives_result"
  1.4002 +	  fi
  1.4003 +	fi
  1.4004 +	
  1.4005 +	if test "$thread_safe" = yes && test -n "$thread_safe_flag_spec"; then
  1.4006 +	  eval flag=\"$thread_safe_flag_spec\"
  1.4007 +	  linker_flags="$linker_flags $flag"
  1.4008 +	fi
  1.4009 +
  1.4010 +	# Make a backup of the uninstalled library when relinking
  1.4011 +	if test "$mode" = relink; then
  1.4012 +	  $run eval '(cd $output_objdir && $rm ${realname}U && $mv $realname ${realname}U)' || exit $?
  1.4013 +	fi
  1.4014 +
  1.4015 +	# Do each of the archive commands.
  1.4016 +	if test "$module" = yes && test -n "$module_cmds" ; then
  1.4017 +	  if test -n "$export_symbols" && test -n "$module_expsym_cmds"; then
  1.4018 +	    eval test_cmds=\"$module_expsym_cmds\"
  1.4019 +	    cmds=$module_expsym_cmds
  1.4020 +	  else
  1.4021 +	    eval test_cmds=\"$module_cmds\"
  1.4022 +	    cmds=$module_cmds
  1.4023 +	  fi
  1.4024 +	else
  1.4025 +	if test -n "$export_symbols" && test -n "$archive_expsym_cmds"; then
  1.4026 +	  eval test_cmds=\"$archive_expsym_cmds\"
  1.4027 +	  cmds=$archive_expsym_cmds
  1.4028 +	else
  1.4029 +	  eval test_cmds=\"$archive_cmds\"
  1.4030 +	  cmds=$archive_cmds
  1.4031 +	  fi
  1.4032 +	fi
  1.4033 +
  1.4034 +	if test "X$skipped_export" != "X:" &&
  1.4035 +	   len=`expr "X$test_cmds" : ".*" 2>/dev/null` &&
  1.4036 +	   test "$len" -le "$max_cmd_len" || test "$max_cmd_len" -le -1; then
  1.4037 +	  :
  1.4038 +	else
  1.4039 +	  # The command line is too long to link in one step, link piecewise.
  1.4040 +	  $echo "creating reloadable object files..."
  1.4041 +
  1.4042 +	  # Save the value of $output and $libobjs because we want to
  1.4043 +	  # use them later.  If we have whole_archive_flag_spec, we
  1.4044 +	  # want to use save_libobjs as it was before
  1.4045 +	  # whole_archive_flag_spec was expanded, because we can't
  1.4046 +	  # assume the linker understands whole_archive_flag_spec.
  1.4047 +	  # This may have to be revisited, in case too many
  1.4048 +	  # convenience libraries get linked in and end up exceeding
  1.4049 +	  # the spec.
  1.4050 +	  if test -z "$convenience" || test -z "$whole_archive_flag_spec"; then
  1.4051 +	    save_libobjs=$libobjs
  1.4052 +	  fi
  1.4053 +	  save_output=$output
  1.4054 +	  output_la=`$echo "X$output" | $Xsed -e "$basename"`
  1.4055 +
  1.4056 +	  # Clear the reloadable object creation command queue and
  1.4057 +	  # initialize k to one.
  1.4058 +	  test_cmds=
  1.4059 +	  concat_cmds=
  1.4060 +	  objlist=
  1.4061 +	  delfiles=
  1.4062 +	  last_robj=
  1.4063 +	  k=1
  1.4064 +	  output=$output_objdir/$output_la-${k}.$objext
  1.4065 +	  # Loop over the list of objects to be linked.
  1.4066 +	  for obj in $save_libobjs
  1.4067 +	  do
  1.4068 +	    eval test_cmds=\"$reload_cmds $objlist $last_robj\"
  1.4069 +	    if test "X$objlist" = X ||
  1.4070 +	       { len=`expr "X$test_cmds" : ".*" 2>/dev/null` &&
  1.4071 +		 test "$len" -le "$max_cmd_len"; }; then
  1.4072 +	      objlist="$objlist $obj"
  1.4073 +	    else
  1.4074 +	      # The command $test_cmds is almost too long, add a
  1.4075 +	      # command to the queue.
  1.4076 +	      if test "$k" -eq 1 ; then
  1.4077 +		# The first file doesn't have a previous command to add.
  1.4078 +		eval concat_cmds=\"$reload_cmds $objlist $last_robj\"
  1.4079 +	      else
  1.4080 +		# All subsequent reloadable object files will link in
  1.4081 +		# the last one created.
  1.4082 +		eval concat_cmds=\"\$concat_cmds~$reload_cmds $objlist $last_robj\"
  1.4083 +	      fi
  1.4084 +	      last_robj=$output_objdir/$output_la-${k}.$objext
  1.4085 +	      k=`expr $k + 1`
  1.4086 +	      output=$output_objdir/$output_la-${k}.$objext
  1.4087 +	      objlist=$obj
  1.4088 +	      len=1
  1.4089 +	    fi
  1.4090 +	  done
  1.4091 +	  # Handle the remaining objects by creating one last
  1.4092 +	  # reloadable object file.  All subsequent reloadable object
  1.4093 +	  # files will link in the last one created.
  1.4094 +	  test -z "$concat_cmds" || concat_cmds=$concat_cmds~
  1.4095 +	  eval concat_cmds=\"\${concat_cmds}$reload_cmds $objlist $last_robj\"
  1.4096 +
  1.4097 +	  if ${skipped_export-false}; then
  1.4098 +	    $show "generating symbol list for \`$libname.la'"
  1.4099 +	    export_symbols="$output_objdir/$libname.exp"
  1.4100 +	    $run $rm $export_symbols
  1.4101 +	    libobjs=$output
  1.4102 +	    # Append the command to create the export file.
  1.4103 +	    eval concat_cmds=\"\$concat_cmds~$export_symbols_cmds\"
  1.4104 +          fi
  1.4105 +
  1.4106 +	  # Set up a command to remove the reloadable object files
  1.4107 +	  # after they are used.
  1.4108 +	  i=0
  1.4109 +	  while test "$i" -lt "$k"
  1.4110 +	  do
  1.4111 +	    i=`expr $i + 1`
  1.4112 +	    delfiles="$delfiles $output_objdir/$output_la-${i}.$objext"
  1.4113 +	  done
  1.4114 +
  1.4115 +	  $echo "creating a temporary reloadable object file: $output"
  1.4116 +
  1.4117 +	  # Loop through the commands generated above and execute them.
  1.4118 +	  save_ifs="$IFS"; IFS='~'
  1.4119 +	  for cmd in $concat_cmds; do
  1.4120 +	    IFS="$save_ifs"
  1.4121 +	    $show "$cmd"
  1.4122 +	    $run eval "$cmd" || exit $?
  1.4123 +	  done
  1.4124 +	  IFS="$save_ifs"
  1.4125 +
  1.4126 +	  libobjs=$output
  1.4127 +	  # Restore the value of output.
  1.4128 +	  output=$save_output
  1.4129 +
  1.4130 +	  if test -n "$convenience" && test -n "$whole_archive_flag_spec"; then
  1.4131 +	    eval libobjs=\"\$libobjs $whole_archive_flag_spec\"
  1.4132 +	  fi
  1.4133 +	  # Expand the library linking commands again to reset the
  1.4134 +	  # value of $libobjs for piecewise linking.
  1.4135 +
  1.4136 +	  # Do each of the archive commands.
  1.4137 +	  if test "$module" = yes && test -n "$module_cmds" ; then
  1.4138 +	    if test -n "$export_symbols" && test -n "$module_expsym_cmds"; then
  1.4139 +	      cmds=$module_expsym_cmds
  1.4140 +	    else
  1.4141 +	      cmds=$module_cmds
  1.4142 +	    fi
  1.4143 +	  else
  1.4144 +	  if test -n "$export_symbols" && test -n "$archive_expsym_cmds"; then
  1.4145 +	    cmds=$archive_expsym_cmds
  1.4146 +	  else
  1.4147 +	    cmds=$archive_cmds
  1.4148 +	    fi
  1.4149 +	  fi
  1.4150 +
  1.4151 +	  # Append the command to remove the reloadable object files
  1.4152 +	  # to the just-reset $cmds.
  1.4153 +	  eval cmds=\"\$cmds~\$rm $delfiles\"
  1.4154 +	fi
  1.4155 +	save_ifs="$IFS"; IFS='~'
  1.4156 +	for cmd in $cmds; do
  1.4157 +	  IFS="$save_ifs"
  1.4158 +	  eval cmd=\"$cmd\"
  1.4159 +	  $show "$cmd"
  1.4160 +	  $run eval "$cmd" || {
  1.4161 +	    lt_exit=$?
  1.4162 +
  1.4163 +	    # Restore the uninstalled library and exit
  1.4164 +	    if test "$mode" = relink; then
  1.4165 +	      $run eval '(cd $output_objdir && $rm ${realname}T && $mv ${realname}U $realname)'
  1.4166 +	    fi
  1.4167 +
  1.4168 +	    exit $lt_exit
  1.4169 +	  }
  1.4170 +	done
  1.4171 +	IFS="$save_ifs"
  1.4172 +
  1.4173 +	# Restore the uninstalled library and exit
  1.4174 +	if test "$mode" = relink; then
  1.4175 +	  $run eval '(cd $output_objdir && $rm ${realname}T && $mv $realname ${realname}T && $mv "$realname"U $realname)' || exit $?
  1.4176 +
  1.4177 +	  if test -n "$convenience"; then
  1.4178 +	    if test -z "$whole_archive_flag_spec"; then
  1.4179 +	      $show "${rm}r $gentop"
  1.4180 +	      $run ${rm}r "$gentop"
  1.4181 +	    fi
  1.4182 +	  fi
  1.4183 +
  1.4184 +	  exit $EXIT_SUCCESS
  1.4185 +	fi
  1.4186 +
  1.4187 +	# Create links to the real library.
  1.4188 +	for linkname in $linknames; do
  1.4189 +	  if test "$realname" != "$linkname"; then
  1.4190 +	    $show "(cd $output_objdir && $rm $linkname && $LN_S $realname $linkname)"
  1.4191 +	    $run eval '(cd $output_objdir && $rm $linkname && $LN_S $realname $linkname)' || exit $?
  1.4192 +	  fi
  1.4193 +	done
  1.4194 +
  1.4195 +	# If -module or -export-dynamic was specified, set the dlname.
  1.4196 +	if test "$module" = yes || test "$export_dynamic" = yes; then
  1.4197 +	  # On all known operating systems, these are identical.
  1.4198 +	  dlname="$soname"
  1.4199 +	fi
  1.4200 +      fi
  1.4201 +      ;;
  1.4202 +
  1.4203 +    obj)
  1.4204 +      if test -n "$deplibs"; then
  1.4205 +	$echo "$modename: warning: \`-l' and \`-L' are ignored for objects" 1>&2
  1.4206 +      fi
  1.4207 +
  1.4208 +      if test -n "$dlfiles$dlprefiles" || test "$dlself" != no; then
  1.4209 +	$echo "$modename: warning: \`-dlopen' is ignored for objects" 1>&2
  1.4210 +      fi
  1.4211 +
  1.4212 +      if test -n "$rpath"; then
  1.4213 +	$echo "$modename: warning: \`-rpath' is ignored for objects" 1>&2
  1.4214 +      fi
  1.4215 +
  1.4216 +      if test -n "$xrpath"; then
  1.4217 +	$echo "$modename: warning: \`-R' is ignored for objects" 1>&2
  1.4218 +      fi
  1.4219 +
  1.4220 +      if test -n "$vinfo"; then
  1.4221 +	$echo "$modename: warning: \`-version-info' is ignored for objects" 1>&2
  1.4222 +      fi
  1.4223 +
  1.4224 +      if test -n "$release"; then
  1.4225 +	$echo "$modename: warning: \`-release' is ignored for objects" 1>&2
  1.4226 +      fi
  1.4227 +
  1.4228 +      case $output in
  1.4229 +      *.lo)
  1.4230 +	if test -n "$objs$old_deplibs"; then
  1.4231 +	  $echo "$modename: cannot build library object \`$output' from non-libtool objects" 1>&2
  1.4232 +	  exit $EXIT_FAILURE
  1.4233 +	fi
  1.4234 +	libobj="$output"
  1.4235 +	obj=`$echo "X$output" | $Xsed -e "$lo2o"`
  1.4236 +	;;
  1.4237 +      *)
  1.4238 +	libobj=
  1.4239 +	obj="$output"
  1.4240 +	;;
  1.4241 +      esac
  1.4242 +
  1.4243 +      # Delete the old objects.
  1.4244 +      $run $rm $obj $libobj
  1.4245 +
  1.4246 +      # Objects from convenience libraries.  This assumes
  1.4247 +      # single-version convenience libraries.  Whenever we create
  1.4248 +      # different ones for PIC/non-PIC, this we'll have to duplicate
  1.4249 +      # the extraction.
  1.4250 +      reload_conv_objs=
  1.4251 +      gentop=
  1.4252 +      # reload_cmds runs $LD directly, so let us get rid of
  1.4253 +      # -Wl from whole_archive_flag_spec
  1.4254 +      wl=
  1.4255 +
  1.4256 +      if test -n "$convenience"; then
  1.4257 +	if test -n "$whole_archive_flag_spec"; then
  1.4258 +	  eval reload_conv_objs=\"\$reload_objs $whole_archive_flag_spec\"
  1.4259 +	else
  1.4260 +	  gentop="$output_objdir/${obj}x"
  1.4261 +	  generated="$generated $gentop"
  1.4262 +
  1.4263 +	  func_extract_archives $gentop $convenience
  1.4264 +	  reload_conv_objs="$reload_objs $func_extract_archives_result"
  1.4265 +	fi
  1.4266 +      fi
  1.4267 +
  1.4268 +      # Create the old-style object.
  1.4269 +      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
  1.4270 +
  1.4271 +      output="$obj"
  1.4272 +      cmds=$reload_cmds
  1.4273 +      save_ifs="$IFS"; IFS='~'
  1.4274 +      for cmd in $cmds; do
  1.4275 +	IFS="$save_ifs"
  1.4276 +	eval cmd=\"$cmd\"
  1.4277 +	$show "$cmd"
  1.4278 +	$run eval "$cmd" || exit $?
  1.4279 +      done
  1.4280 +      IFS="$save_ifs"
  1.4281 +
  1.4282 +      # Exit if we aren't doing a library object file.
  1.4283 +      if test -z "$libobj"; then
  1.4284 +	if test -n "$gentop"; then
  1.4285 +	  $show "${rm}r $gentop"
  1.4286 +	  $run ${rm}r $gentop
  1.4287 +	fi
  1.4288 +
  1.4289 +	exit $EXIT_SUCCESS
  1.4290 +      fi
  1.4291 +
  1.4292 +      if test "$build_libtool_libs" != yes; then
  1.4293 +	if test -n "$gentop"; then
  1.4294 +	  $show "${rm}r $gentop"
  1.4295 +	  $run ${rm}r $gentop
  1.4296 +	fi
  1.4297 +
  1.4298 +	# Create an invalid libtool object if no PIC, so that we don't
  1.4299 +	# accidentally link it into a program.
  1.4300 +	# $show "echo timestamp > $libobj"
  1.4301 +	# $run eval "echo timestamp > $libobj" || exit $?
  1.4302 +	exit $EXIT_SUCCESS
  1.4303 +      fi
  1.4304 +
  1.4305 +      if test -n "$pic_flag" || test "$pic_mode" != default; then
  1.4306 +	# Only do commands if we really have different PIC objects.
  1.4307 +	reload_objs="$libobjs $reload_conv_objs"
  1.4308 +	output="$libobj"
  1.4309 +	cmds=$reload_cmds
  1.4310 +	save_ifs="$IFS"; IFS='~'
  1.4311 +	for cmd in $cmds; do
  1.4312 +	  IFS="$save_ifs"
  1.4313 +	  eval cmd=\"$cmd\"
  1.4314 +	  $show "$cmd"
  1.4315 +	  $run eval "$cmd" || exit $?
  1.4316 +	done
  1.4317 +	IFS="$save_ifs"
  1.4318 +      fi
  1.4319 +
  1.4320 +      if test -n "$gentop"; then
  1.4321 +	$show "${rm}r $gentop"
  1.4322 +	$run ${rm}r $gentop
  1.4323 +      fi
  1.4324 +
  1.4325 +      exit $EXIT_SUCCESS
  1.4326 +      ;;
  1.4327 +
  1.4328 +    prog)
  1.4329 +      case $host in
  1.4330 +	*cygwin*) output=`$echo $output | ${SED} -e 's,.exe$,,;s,$,.exe,'` ;;
  1.4331 +      esac
  1.4332 +      if test -n "$vinfo"; then
  1.4333 +	$echo "$modename: warning: \`-version-info' is ignored for programs" 1>&2
  1.4334 +      fi
  1.4335 +
  1.4336 +      if test -n "$release"; then
  1.4337 +	$echo "$modename: warning: \`-release' is ignored for programs" 1>&2
  1.4338 +      fi
  1.4339 +
  1.4340 +      if test "$preload" = yes; then
  1.4341 +	if test "$dlopen_support" = unknown && test "$dlopen_self" = unknown &&
  1.4342 +	   test "$dlopen_self_static" = unknown; then
  1.4343 +	  $echo "$modename: warning: \`AC_LIBTOOL_DLOPEN' not used. Assuming no dlopen support."
  1.4344 +	fi
  1.4345 +      fi
  1.4346 +
  1.4347 +      case $host in
  1.4348 +      *-*-rhapsody* | *-*-darwin1.[012])
  1.4349 +	# On Rhapsody replace the C library is the System framework
  1.4350 +	compile_deplibs=`$echo "X $compile_deplibs" | $Xsed -e 's/ -lc / -framework System /'`
  1.4351 +	finalize_deplibs=`$echo "X $finalize_deplibs" | $Xsed -e 's/ -lc / -framework System /'`
  1.4352 +	;;
  1.4353 +      esac
  1.4354 +
  1.4355 +      case $host in
  1.4356 +      *darwin*)
  1.4357 +        # Don't allow lazy linking, it breaks C++ global constructors
  1.4358 +        if test "$tagname" = CXX ; then
  1.4359 +        compile_command="$compile_command ${wl}-bind_at_load"
  1.4360 +        finalize_command="$finalize_command ${wl}-bind_at_load"
  1.4361 +        fi
  1.4362 +        ;;
  1.4363 +      esac
  1.4364 +
  1.4365 +
  1.4366 +      # move library search paths that coincide with paths to not yet
  1.4367 +      # installed libraries to the beginning of the library search list
  1.4368 +      new_libs=
  1.4369 +      for path in $notinst_path; do
  1.4370 +	case " $new_libs " in
  1.4371 +	*" -L$path/$objdir "*) ;;
  1.4372 +	*)
  1.4373 +	  case " $compile_deplibs " in
  1.4374 +	  *" -L$path/$objdir "*)
  1.4375 +	    new_libs="$new_libs -L$path/$objdir" ;;
  1.4376 +	  esac
  1.4377 +	  ;;
  1.4378 +	esac
  1.4379 +      done
  1.4380 +      for deplib in $compile_deplibs; do
  1.4381 +	case $deplib in
  1.4382 +	-L*)
  1.4383 +	  case " $new_libs " in
  1.4384 +	  *" $deplib "*) ;;
  1.4385 +	  *) new_libs="$new_libs $deplib" ;;
  1.4386 +	  esac
  1.4387 +	  ;;
  1.4388 +	*) new_libs="$new_libs $deplib" ;;
  1.4389 +	esac
  1.4390 +      done
  1.4391 +      compile_deplibs="$new_libs"
  1.4392 +
  1.4393 +
  1.4394 +      compile_command="$compile_command $compile_deplibs"
  1.4395 +      finalize_command="$finalize_command $finalize_deplibs"
  1.4396 +
  1.4397 +      if test -n "$rpath$xrpath"; then
  1.4398 +	# If the user specified any rpath flags, then add them.
  1.4399 +	for libdir in $rpath $xrpath; do
  1.4400 +	  # This is the magic to use -rpath.
  1.4401 +	  case "$finalize_rpath " in
  1.4402 +	  *" $libdir "*) ;;
  1.4403 +	  *) finalize_rpath="$finalize_rpath $libdir" ;;
  1.4404 +	  esac
  1.4405 +	done
  1.4406 +      fi
  1.4407 +
  1.4408 +      # Now hardcode the library paths
  1.4409 +      rpath=
  1.4410 +      hardcode_libdirs=
  1.4411 +      for libdir in $compile_rpath $finalize_rpath; do
  1.4412 +	if test -n "$hardcode_libdir_flag_spec"; then
  1.4413 +	  if test -n "$hardcode_libdir_separator"; then
  1.4414 +	    if test -z "$hardcode_libdirs"; then
  1.4415 +	      hardcode_libdirs="$libdir"
  1.4416 +	    else
  1.4417 +	      # Just accumulate the unique libdirs.
  1.4418 +	      case $hardcode_libdir_separator$hardcode_libdirs$hardcode_libdir_separator in
  1.4419 +	      *"$hardcode_libdir_separator$libdir$hardcode_libdir_separator"*)
  1.4420 +		;;
  1.4421 +	      *)
  1.4422 +		hardcode_libdirs="$hardcode_libdirs$hardcode_libdir_separator$libdir"
  1.4423 +		;;
  1.4424 +	      esac
  1.4425 +	    fi
  1.4426 +	  else
  1.4427 +	    eval flag=\"$hardcode_libdir_flag_spec\"
  1.4428 +	    rpath="$rpath $flag"
  1.4429 +	  fi
  1.4430 +	elif test -n "$runpath_var"; then
  1.4431 +	  case "$perm_rpath " in
  1.4432 +	  *" $libdir "*) ;;
  1.4433 +	  *) perm_rpath="$perm_rpath $libdir" ;;
  1.4434 +	  esac
  1.4435 +	fi
  1.4436 +	case $host in
  1.4437 +	*-*-cygwin* | *-*-mingw* | *-*-pw32* | *-*-os2*)
  1.4438 +	  testbindir=`$echo "X$libdir" | $Xsed -e 's*/lib$*/bin*'`
  1.4439 +	  case :$dllsearchpath: in
  1.4440 +	  *":$libdir:"*) ;;
  1.4441 +	  *) dllsearchpath="$dllsearchpath:$libdir";;
  1.4442 +	  esac
  1.4443 +	  case :$dllsearchpath: in
  1.4444 +	  *":$testbindir:"*) ;;
  1.4445 +	  *) dllsearchpath="$dllsearchpath:$testbindir";;
  1.4446 +	  esac
  1.4447 +	  ;;
  1.4448 +	esac
  1.4449 +      done
  1.4450 +      # Substitute the hardcoded libdirs into the rpath.
  1.4451 +      if test -n "$hardcode_libdir_separator" &&
  1.4452 +	 test -n "$hardcode_libdirs"; then
  1.4453 +	libdir="$hardcode_libdirs"
  1.4454 +	eval rpath=\" $hardcode_libdir_flag_spec\"
  1.4455 +      fi
  1.4456 +      compile_rpath="$rpath"
  1.4457 +
  1.4458 +      rpath=
  1.4459 +      hardcode_libdirs=
  1.4460 +      for libdir in $finalize_rpath; do
  1.4461 +	if test -n "$hardcode_libdir_flag_spec"; then
  1.4462 +	  if test -n "$hardcode_libdir_separator"; then
  1.4463 +	    if test -z "$hardcode_libdirs"; then
  1.4464 +	      hardcode_libdirs="$libdir"
  1.4465 +	    else
  1.4466 +	      # Just accumulate the unique libdirs.
  1.4467 +	      case $hardcode_libdir_separator$hardcode_libdirs$hardcode_libdir_separator in
  1.4468 +	      *"$hardcode_libdir_separator$libdir$hardcode_libdir_separator"*)
  1.4469 +		;;
  1.4470 +	      *)
  1.4471 +		hardcode_libdirs="$hardcode_libdirs$hardcode_libdir_separator$libdir"
  1.4472 +		;;
  1.4473 +	      esac
  1.4474 +	    fi
  1.4475 +	  else
  1.4476 +	    eval flag=\"$hardcode_libdir_flag_spec\"
  1.4477 +	    rpath="$rpath $flag"
  1.4478 +	  fi
  1.4479 +	elif test -n "$runpath_var"; then
  1.4480 +	  case "$finalize_perm_rpath " in
  1.4481 +	  *" $libdir "*) ;;
  1.4482 +	  *) finalize_perm_rpath="$finalize_perm_rpath $libdir" ;;
  1.4483 +	  esac
  1.4484 +	fi
  1.4485 +      done
  1.4486 +      # Substitute the hardcoded libdirs into the rpath.
  1.4487 +      if test -n "$hardcode_libdir_separator" &&
  1.4488 +	 test -n "$hardcode_libdirs"; then
  1.4489 +	libdir="$hardcode_libdirs"
  1.4490 +	eval rpath=\" $hardcode_libdir_flag_spec\"
  1.4491 +      fi
  1.4492 +      finalize_rpath="$rpath"
  1.4493 +
  1.4494 +      if test -n "$libobjs" && test "$build_old_libs" = yes; then
  1.4495 +	# Transform all the library objects into standard objects.
  1.4496 +	compile_command=`$echo "X$compile_command" | $SP2NL | $Xsed -e "$lo2o" | $NL2SP`
  1.4497 +	finalize_command=`$echo "X$finalize_command" | $SP2NL | $Xsed -e "$lo2o" | $NL2SP`
  1.4498 +      fi
  1.4499 +
  1.4500 +      dlsyms=
  1.4501 +      if test -n "$dlfiles$dlprefiles" || test "$dlself" != no; then
  1.4502 +	if test -n "$NM" && test -n "$global_symbol_pipe"; then
  1.4503 +	  dlsyms="${outputname}S.c"
  1.4504 +	else
  1.4505 +	  $echo "$modename: not configured to extract global symbols from dlpreopened files" 1>&2
  1.4506 +	fi
  1.4507 +      fi
  1.4508 +
  1.4509 +      if test -n "$dlsyms"; then
  1.4510 +	case $dlsyms in
  1.4511 +	"") ;;
  1.4512 +	*.c)
  1.4513 +	  # Discover the nlist of each of the dlfiles.
  1.4514 +	  nlist="$output_objdir/${outputname}.nm"
  1.4515 +
  1.4516 +	  $show "$rm $nlist ${nlist}S ${nlist}T"
  1.4517 +	  $run $rm "$nlist" "${nlist}S" "${nlist}T"
  1.4518 +
  1.4519 +	  # Parse the name list into a source file.
  1.4520 +	  $show "creating $output_objdir/$dlsyms"
  1.4521 +
  1.4522 +	  test -z "$run" && $echo > "$output_objdir/$dlsyms" "\
  1.4523 +/* $dlsyms - symbol resolution table for \`$outputname' dlsym emulation. */
  1.4524 +/* Generated by $PROGRAM - GNU $PACKAGE $VERSION$TIMESTAMP */
  1.4525 +
  1.4526 +#ifdef __cplusplus
  1.4527 +extern \"C\" {
  1.4528 +#endif
  1.4529 +
  1.4530 +/* Prevent the only kind of declaration conflicts we can make. */
  1.4531 +#define lt_preloaded_symbols some_other_symbol
  1.4532 +
  1.4533 +/* External symbol declarations for the compiler. */\
  1.4534 +"
  1.4535 +
  1.4536 +	  if test "$dlself" = yes; then
  1.4537 +	    $show "generating symbol list for \`$output'"
  1.4538 +
  1.4539 +	    test -z "$run" && $echo ': @PROGRAM@ ' > "$nlist"
  1.4540 +
  1.4541 +	    # Add our own program objects to the symbol list.
  1.4542 +	    progfiles=`$echo "X$objs$old_deplibs" | $SP2NL | $Xsed -e "$lo2o" | $NL2SP`
  1.4543 +	    for arg in $progfiles; do
  1.4544 +	      $show "extracting global C symbols from \`$arg'"
  1.4545 +	      $run eval "$NM $arg | $global_symbol_pipe >> '$nlist'"
  1.4546 +	    done
  1.4547 +
  1.4548 +	    if test -n "$exclude_expsyms"; then
  1.4549 +	      $run eval '$EGREP -v " ($exclude_expsyms)$" "$nlist" > "$nlist"T'
  1.4550 +	      $run eval '$mv "$nlist"T "$nlist"'
  1.4551 +	    fi
  1.4552 +
  1.4553 +	    if test -n "$export_symbols_regex"; then
  1.4554 +	      $run eval '$EGREP -e "$export_symbols_regex" "$nlist" > "$nlist"T'
  1.4555 +	      $run eval '$mv "$nlist"T "$nlist"'
  1.4556 +	    fi
  1.4557 +
  1.4558 +	    # Prepare the list of exported symbols
  1.4559 +	    if test -z "$export_symbols"; then
  1.4560 +	      export_symbols="$output_objdir/$outputname.exp"
  1.4561 +	      $run $rm $export_symbols
  1.4562 +	      $run eval "${SED} -n -e '/^: @PROGRAM@ $/d' -e 's/^.* \(.*\)$/\1/p' "'< "$nlist" > "$export_symbols"'
  1.4563 +              case $host in
  1.4564 +              *cygwin* | *mingw* )
  1.4565 +	        $run eval "echo EXPORTS "'> "$output_objdir/$outputname.def"'
  1.4566 +		$run eval 'cat "$export_symbols" >> "$output_objdir/$outputname.def"'
  1.4567 +                ;;
  1.4568 +              esac
  1.4569 +	    else
  1.4570 +	      $run eval "${SED} -e 's/\([].[*^$]\)/\\\\\1/g' -e 's/^/ /' -e 's/$/$/'"' < "$export_symbols" > "$output_objdir/$outputname.exp"'
  1.4571 +	      $run eval 'grep -f "$output_objdir/$outputname.exp" < "$nlist" > "$nlist"T'
  1.4572 +	      $run eval 'mv "$nlist"T "$nlist"'
  1.4573 +              case $host in
  1.4574 +              *cygwin* | *mingw* )
  1.4575 +	        $run eval "echo EXPORTS "'> "$output_objdir/$outputname.def"'
  1.4576 +		$run eval 'cat "$nlist" >> "$output_objdir/$outputname.def"'
  1.4577 +                ;;
  1.4578 +              esac
  1.4579 +	    fi
  1.4580 +	  fi
  1.4581 +
  1.4582 +	  for arg in $dlprefiles; do
  1.4583 +	    $show "extracting global C symbols from \`$arg'"
  1.4584 +	    name=`$echo "$arg" | ${SED} -e 's%^.*/%%'`
  1.4585 +	    $run eval '$echo ": $name " >> "$nlist"'
  1.4586 +	    $run eval "$NM $arg | $global_symbol_pipe >> '$nlist'"
  1.4587 +	  done
  1.4588 +
  1.4589 +	  if test -z "$run"; then
  1.4590 +	    # Make sure we have at least an empty file.
  1.4591 +	    test -f "$nlist" || : > "$nlist"
  1.4592 +
  1.4593 +	    if test -n "$exclude_expsyms"; then
  1.4594 +	      $EGREP -v " ($exclude_expsyms)$" "$nlist" > "$nlist"T
  1.4595 +	      $mv "$nlist"T "$nlist"
  1.4596 +	    fi
  1.4597 +
  1.4598 +	    # Try sorting and uniquifying the output.
  1.4599 +	    if grep -v "^: " < "$nlist" |
  1.4600 +		if sort -k 3 </dev/null >/dev/null 2>&1; then
  1.4601 +		  sort -k 3
  1.4602 +		else
  1.4603 +		  sort +2
  1.4604 +		fi |
  1.4605 +		uniq > "$nlist"S; then
  1.4606 +	      :
  1.4607 +	    else
  1.4608 +	      grep -v "^: " < "$nlist" > "$nlist"S
  1.4609 +	    fi
  1.4610 +
  1.4611 +	    if test -f "$nlist"S; then
  1.4612 +	      eval "$global_symbol_to_cdecl"' < "$nlist"S >> "$output_objdir/$dlsyms"'
  1.4613 +	    else
  1.4614 +	      $echo '/* NONE */' >> "$output_objdir/$dlsyms"
  1.4615 +	    fi
  1.4616 +
  1.4617 +	    $echo >> "$output_objdir/$dlsyms" "\
  1.4618 +
  1.4619 +#undef lt_preloaded_symbols
  1.4620 +
  1.4621 +#if defined (__STDC__) && __STDC__
  1.4622 +# define lt_ptr void *
  1.4623 +#else
  1.4624 +# define lt_ptr char *
  1.4625 +# define const
  1.4626 +#endif
  1.4627 +
  1.4628 +/* The mapping between symbol names and symbols. */
  1.4629 +"
  1.4630 +
  1.4631 +	    case $host in
  1.4632 +	    *cygwin* | *mingw* )
  1.4633 +	  $echo >> "$output_objdir/$dlsyms" "\
  1.4634 +/* DATA imports from DLLs on WIN32 can't be const, because
  1.4635 +   runtime relocations are performed -- see ld's documentation
  1.4636 +   on pseudo-relocs */
  1.4637 +struct {
  1.4638 +"
  1.4639 +	      ;;
  1.4640 +	    * )
  1.4641 +	  $echo >> "$output_objdir/$dlsyms" "\
  1.4642 +const struct {
  1.4643 +"
  1.4644 +	      ;;
  1.4645 +	    esac
  1.4646 +
  1.4647 +
  1.4648 +	  $echo >> "$output_objdir/$dlsyms" "\
  1.4649 +  const char *name;
  1.4650 +  lt_ptr address;
  1.4651 +}
  1.4652 +lt_preloaded_symbols[] =
  1.4653 +{\
  1.4654 +"
  1.4655 +
  1.4656 +	    eval "$global_symbol_to_c_name_address" < "$nlist" >> "$output_objdir/$dlsyms"
  1.4657 +
  1.4658 +	    $echo >> "$output_objdir/$dlsyms" "\
  1.4659 +  {0, (lt_ptr) 0}
  1.4660 +};
  1.4661 +
  1.4662 +/* This works around a problem in FreeBSD linker */
  1.4663 +#ifdef FREEBSD_WORKAROUND
  1.4664 +static const void *lt_preloaded_setup() {
  1.4665 +  return lt_preloaded_symbols;
  1.4666 +}
  1.4667 +#endif
  1.4668 +
  1.4669 +#ifdef __cplusplus
  1.4670 +}
  1.4671 +#endif\
  1.4672 +"
  1.4673 +	  fi
  1.4674 +
  1.4675 +	  pic_flag_for_symtable=
  1.4676 +	  case $host in
  1.4677 +	  # compiling the symbol table file with pic_flag works around
  1.4678 +	  # a FreeBSD bug that causes programs to crash when -lm is
  1.4679 +	  # linked before any other PIC object.  But we must not use
  1.4680 +	  # pic_flag when linking with -static.  The problem exists in
  1.4681 +	  # FreeBSD 2.2.6 and is fixed in FreeBSD 3.1.
  1.4682 +	  *-*-freebsd2*|*-*-freebsd3.0*|*-*-freebsdelf3.0*)
  1.4683 +	    case "$compile_command " in
  1.4684 +	    *" -static "*) ;;
  1.4685 +	    *) pic_flag_for_symtable=" $pic_flag -DFREEBSD_WORKAROUND";;
  1.4686 +	    esac;;
  1.4687 +	  *-*-hpux*)
  1.4688 +	    case "$compile_command " in
  1.4689 +	    *" -static "*) ;;
  1.4690 +	    *) pic_flag_for_symtable=" $pic_flag";;
  1.4691 +	    esac
  1.4692 +	  esac
  1.4693 +
  1.4694 +	  # Now compile the dynamic symbol file.
  1.4695 +	  $show "(cd $output_objdir && $LTCC  $LTCFLAGS -c$no_builtin_flag$pic_flag_for_symtable \"$dlsyms\")"
  1.4696 +	  $run eval '(cd $output_objdir && $LTCC  $LTCFLAGS -c$no_builtin_flag$pic_flag_for_symtable "$dlsyms")' || exit $?
  1.4697 +
  1.4698 +	  # Clean up the generated files.
  1.4699 +	  $show "$rm $output_objdir/$dlsyms $nlist ${nlist}S ${nlist}T"
  1.4700 +	  $run $rm "$output_objdir/$dlsyms" "$nlist" "${nlist}S" "${nlist}T"
  1.4701 +
  1.4702 +	  # Transform the symbol file into the correct name.
  1.4703 +          case $host in
  1.4704 +          *cygwin* | *mingw* )
  1.4705 +            if test -f "$output_objdir/${outputname}.def" ; then
  1.4706 +              compile_command=`$echo "X$compile_command" | $Xsed -e "s%@SYMFILE@%$output_objdir/${outputname}.def $output_objdir/${outputname}S.${objext}%"`
  1.4707 +              finalize_command=`$echo "X$finalize_command" | $Xsed -e "s%@SYMFILE@%$output_objdir/${outputname}.def $output_objdir/${outputname}S.${objext}%"`
  1.4708 +            else
  1.4709 +              compile_command=`$echo "X$compile_command" | $Xsed -e "s%@SYMFILE@%$output_objdir/${outputname}S.${objext}%"`
  1.4710 +              finalize_command=`$echo "X$finalize_command" | $Xsed -e "s%@SYMFILE@%$output_objdir/${outputname}S.${objext}%"`
  1.4711 +             fi
  1.4712 +            ;;
  1.4713 +          * )
  1.4714 +            compile_command=`$echo "X$compile_command" | $Xsed -e "s%@SYMFILE@%$output_objdir/${outputname}S.${objext}%"`
  1.4715 +            finalize_command=`$echo "X$finalize_command" | $Xsed -e "s%@SYMFILE@%$output_objdir/${outputname}S.${objext}%"`
  1.4716 +            ;;
  1.4717 +          esac
  1.4718 +	  ;;
  1.4719 +	*)
  1.4720 +	  $echo "$modename: unknown suffix for \`$dlsyms'" 1>&2
  1.4721 +	  exit $EXIT_FAILURE
  1.4722 +	  ;;
  1.4723 +	esac
  1.4724 +      else
  1.4725 +	# We keep going just in case the user didn't refer to
  1.4726 +	# lt_preloaded_symbols.  The linker will fail if global_symbol_pipe
  1.4727 +	# really was required.
  1.4728 +
  1.4729 +	# Nullify the symbol file.
  1.4730 +	compile_command=`$echo "X$compile_command" | $Xsed -e "s% @SYMFILE@%%"`
  1.4731 +	finalize_command=`$echo "X$finalize_command" | $Xsed -e "s% @SYMFILE@%%"`
  1.4732 +      fi
  1.4733 +
  1.4734 +      if test "$need_relink" = no || test "$build_libtool_libs" != yes; then
  1.4735 +	# Replace the output file specification.
  1.4736 +	compile_command=`$echo "X$compile_command" | $Xsed -e 's%@OUTPUT@%'"$output"'%g'`
  1.4737 +	link_command="$compile_command$compile_rpath"
  1.4738 +
  1.4739 +	# We have no uninstalled library dependencies, so finalize right now.
  1.4740 +	$show "$link_command"
  1.4741 +	$run eval "$link_command"
  1.4742 +	exit_status=$?
  1.4743 +
  1.4744 +	# Delete the generated files.
  1.4745 +	if test -n "$dlsyms"; then
  1.4746 +	  $show "$rm $output_objdir/${outputname}S.${objext}"
  1.4747 +	  $run $rm "$output_objdir/${outputname}S.${objext}"
  1.4748 +	fi
  1.4749 +
  1.4750 +	exit $exit_status
  1.4751 +      fi
  1.4752 +
  1.4753 +      if test -n "$shlibpath_var"; then
  1.4754 +	# We should set the shlibpath_var
  1.4755 +	rpath=
  1.4756 +	for dir in $temp_rpath; do
  1.4757 +	  case $dir in
  1.4758 +	  [\\/]* | [A-Za-z]:[\\/]*)
  1.4759 +	    # Absolute path.
  1.4760 +	    rpath="$rpath$dir:"
  1.4761 +	    ;;
  1.4762 +	  *)
  1.4763 +	    # Relative path: add a thisdir entry.
  1.4764 +	    rpath="$rpath\$thisdir/$dir:"
  1.4765 +	    ;;
  1.4766 +	  esac
  1.4767 +	done
  1.4768 +	temp_rpath="$rpath"
  1.4769 +      fi
  1.4770 +
  1.4771 +      if test -n "$compile_shlibpath$finalize_shlibpath"; then
  1.4772 +	compile_command="$shlibpath_var=\"$compile_shlibpath$finalize_shlibpath\$$shlibpath_var\" $compile_command"
  1.4773 +      fi
  1.4774 +      if test -n "$finalize_shlibpath"; then
  1.4775 +	finalize_command="$shlibpath_var=\"$finalize_shlibpath\$$shlibpath_var\" $finalize_command"
  1.4776 +      fi
  1.4777 +
  1.4778 +      compile_var=
  1.4779 +      finalize_var=
  1.4780 +      if test -n "$runpath_var"; then
  1.4781 +	if test -n "$perm_rpath"; then
  1.4782 +	  # We should set the runpath_var.
  1.4783 +	  rpath=
  1.4784 +	  for dir in $perm_rpath; do
  1.4785 +	    rpath="$rpath$dir:"
  1.4786 +	  done
  1.4787 +	  compile_var="$runpath_var=\"$rpath\$$runpath_var\" "
  1.4788 +	fi
  1.4789 +	if test -n "$finalize_perm_rpath"; then
  1.4790 +	  # We should set the runpath_var.
  1.4791 +	  rpath=
  1.4792 +	  for dir in $finalize_perm_rpath; do
  1.4793 +	    rpath="$rpath$dir:"
  1.4794 +	  done
  1.4795 +	  finalize_var="$runpath_var=\"$rpath\$$runpath_var\" "
  1.4796 +	fi
  1.4797 +      fi
  1.4798 +
  1.4799 +      if test "$no_install" = yes; then
  1.4800 +	# We don't need to create a wrapper script.
  1.4801 +	link_command="$compile_var$compile_command$compile_rpath"
  1.4802 +	# Replace the output file specification.
  1.4803 +	link_command=`$echo "X$link_command" | $Xsed -e 's%@OUTPUT@%'"$output"'%g'`
  1.4804 +	# Delete the old output file.
  1.4805 +	$run $rm $output
  1.4806 +	# Link the executable and exit
  1.4807 +	$show "$link_command"
  1.4808 +	$run eval "$link_command" || exit $?
  1.4809 +	exit $EXIT_SUCCESS
  1.4810 +      fi
  1.4811 +
  1.4812 +      if test "$hardcode_action" = relink; then
  1.4813 +	# Fast installation is not supported
  1.4814 +	link_command="$compile_var$compile_command$compile_rpath"
  1.4815 +	relink_command="$finalize_var$finalize_command$finalize_rpath"
  1.4816 +
  1.4817 +	$echo "$modename: warning: this platform does not like uninstalled shared libraries" 1>&2
  1.4818 +	$echo "$modename: \`$output' will be relinked during installation" 1>&2
  1.4819 +      else
  1.4820 +	if test "$fast_install" != no; then
  1.4821 +	  link_command="$finalize_var$compile_command$finalize_rpath"
  1.4822 +	  if test "$fast_install" = yes; then
  1.4823 +	    relink_command=`$echo "X$compile_var$compile_command$compile_rpath" | $Xsed -e 's%@OUTPUT@%\$progdir/\$file%g'`
  1.4824 +	  else
  1.4825 +	    # fast_install is set to needless
  1.4826 +	    relink_command=
  1.4827 +	  fi
  1.4828 +	else
  1.4829 +	  link_command="$compile_var$compile_command$compile_rpath"
  1.4830 +	  relink_command="$finalize_var$finalize_command$finalize_rpath"
  1.4831 +	fi
  1.4832 +      fi
  1.4833 +
  1.4834 +      # Replace the output file specification.
  1.4835 +      link_command=`$echo "X$link_command" | $Xsed -e 's%@OUTPUT@%'"$output_objdir/$outputname"'%g'`
  1.4836 +
  1.4837 +      # Delete the old output files.
  1.4838 +      $run $rm $output $output_objdir/$outputname $output_objdir/lt-$outputname
  1.4839 +
  1.4840 +      $show "$link_command"
  1.4841 +      $run eval "$link_command" || exit $?
  1.4842 +
  1.4843 +      # Now create the wrapper script.
  1.4844 +      $show "creating $output"
  1.4845 +
  1.4846 +      # Quote the relink command for shipping.
  1.4847 +      if test -n "$relink_command"; then
  1.4848 +	# Preserve any variables that may affect compiler behavior
  1.4849 +	for var in $variables_saved_for_relink; do
  1.4850 +	  if eval test -z \"\${$var+set}\"; then
  1.4851 +	    relink_command="{ test -z \"\${$var+set}\" || unset $var || { $var=; export $var; }; }; $relink_command"
  1.4852 +	  elif eval var_value=\$$var; test -z "$var_value"; then
  1.4853 +	    relink_command="$var=; export $var; $relink_command"
  1.4854 +	  else
  1.4855 +	    var_value=`$echo "X$var_value" | $Xsed -e "$sed_quote_subst"`
  1.4856 +	    relink_command="$var=\"$var_value\"; export $var; $relink_command"
  1.4857 +	  fi
  1.4858 +	done
  1.4859 +	relink_command="(cd `pwd`; $relink_command)"
  1.4860 +	relink_command=`$echo "X$relink_command" | $Xsed -e "$sed_quote_subst"`
  1.4861 +      fi
  1.4862 +
  1.4863 +      # Quote $echo for shipping.
  1.4864 +      if test "X$echo" = "X$SHELL $progpath --fallback-echo"; then
  1.4865 +	case $progpath in
  1.4866 +	[\\/]* | [A-Za-z]:[\\/]*) qecho="$SHELL $progpath --fallback-echo";;
  1.4867 +	*) qecho="$SHELL `pwd`/$progpath --fallback-echo";;
  1.4868 +	esac
  1.4869 +	qecho=`$echo "X$qecho" | $Xsed -e "$sed_quote_subst"`
  1.4870 +      else
  1.4871 +	qecho=`$echo "X$echo" | $Xsed -e "$sed_quote_subst"`
  1.4872 +      fi
  1.4873 +
  1.4874 +      # Only actually do things if our run command is non-null.
  1.4875 +      if test -z "$run"; then
  1.4876 +	# win32 will think the script is a binary if it has
  1.4877 +	# a .exe suffix, so we strip it off here.
  1.4878 +	case $output in
  1.4879 +	  *.exe) output=`$echo $output|${SED} 's,.exe$,,'` ;;
  1.4880 +	esac
  1.4881 +	# test for cygwin because mv fails w/o .exe extensions
  1.4882 +	case $host in
  1.4883 +	  *cygwin*)
  1.4884 +	    exeext=.exe
  1.4885 +	    outputname=`$echo $outputname|${SED} 's,.exe$,,'` ;;
  1.4886 +	  *) exeext= ;;
  1.4887 +	esac
  1.4888 +	case $host in
  1.4889 +	  *cygwin* | *mingw* )
  1.4890 +            output_name=`basename $output`
  1.4891 +            output_path=`dirname $output`
  1.4892 +            cwrappersource="$output_path/$objdir/lt-$output_name.c"
  1.4893 +            cwrapper="$output_path/$output_name.exe"
  1.4894 +            $rm $cwrappersource $cwrapper
  1.4895 +            trap "$rm $cwrappersource $cwrapper; exit $EXIT_FAILURE" 1 2 15
  1.4896 +
  1.4897 +	    cat > $cwrappersource <<EOF
  1.4898 +
  1.4899 +/* $cwrappersource - temporary wrapper executable for $objdir/$outputname
  1.4900 +   Generated by $PROGRAM - GNU $PACKAGE $VERSION$TIMESTAMP
  1.4901 +
  1.4902 +   The $output program cannot be directly executed until all the libtool
  1.4903 +   libraries that it depends on are installed.
  1.4904 +
  1.4905 +   This wrapper executable should never be moved out of the build directory.
  1.4906 +   If it is, it will not operate correctly.
  1.4907 +
  1.4908 +   Currently, it simply execs the wrapper *script* "/bin/sh $output",
  1.4909 +   but could eventually absorb all of the scripts functionality and
  1.4910 +   exec $objdir/$outputname directly.
  1.4911 +*/
  1.4912 +EOF
  1.4913 +	    cat >> $cwrappersource<<"EOF"
  1.4914 +#include <stdio.h>
  1.4915 +#include <stdlib.h>
  1.4916 +#include <unistd.h>
  1.4917 +#include <malloc.h>
  1.4918 +#include <stdarg.h>
  1.4919 +#include <assert.h>
  1.4920 +#include <string.h>
  1.4921 +#include <ctype.h>
  1.4922 +#include <sys/stat.h>
  1.4923 +
  1.4924 +#if defined(PATH_MAX)
  1.4925 +# define LT_PATHMAX PATH_MAX
  1.4926 +#elif defined(MAXPATHLEN)
  1.4927 +# define LT_PATHMAX MAXPATHLEN
  1.4928 +#else
  1.4929 +# define LT_PATHMAX 1024
  1.4930 +#endif
  1.4931 +
  1.4932 +#ifndef DIR_SEPARATOR
  1.4933 +# define DIR_SEPARATOR '/'
  1.4934 +# define PATH_SEPARATOR ':'
  1.4935 +#endif
  1.4936 +
  1.4937 +#if defined (_WIN32) || defined (__MSDOS__) || defined (__DJGPP__) || \
  1.4938 +  defined (__OS2__)
  1.4939 +# define HAVE_DOS_BASED_FILE_SYSTEM
  1.4940 +# ifndef DIR_SEPARATOR_2
  1.4941 +#  define DIR_SEPARATOR_2 '\\'
  1.4942 +# endif
  1.4943 +# ifndef PATH_SEPARATOR_2
  1.4944 +#  define PATH_SEPARATOR_2 ';'
  1.4945 +# endif
  1.4946 +#endif
  1.4947 +
  1.4948 +#ifndef DIR_SEPARATOR_2
  1.4949 +# define IS_DIR_SEPARATOR(ch) ((ch) == DIR_SEPARATOR)
  1.4950 +#else /* DIR_SEPARATOR_2 */
  1.4951 +# define IS_DIR_SEPARATOR(ch) \
  1.4952 +        (((ch) == DIR_SEPARATOR) || ((ch) == DIR_SEPARATOR_2))
  1.4953 +#endif /* DIR_SEPARATOR_2 */
  1.4954 +
  1.4955 +#ifndef PATH_SEPARATOR_2
  1.4956 +# define IS_PATH_SEPARATOR(ch) ((ch) == PATH_SEPARATOR)
  1.4957 +#else /* PATH_SEPARATOR_2 */
  1.4958 +# define IS_PATH_SEPARATOR(ch) ((ch) == PATH_SEPARATOR_2)
  1.4959 +#endif /* PATH_SEPARATOR_2 */
  1.4960 +
  1.4961 +#define XMALLOC(type, num)      ((type *) xmalloc ((num) * sizeof(type)))
  1.4962 +#define XFREE(stale) do { \
  1.4963 +  if (stale) { free ((void *) stale); stale = 0; } \
  1.4964 +} while (0)
  1.4965 +
  1.4966 +/* -DDEBUG is fairly common in CFLAGS.  */
  1.4967 +#undef DEBUG
  1.4968 +#if defined DEBUGWRAPPER
  1.4969 +# define DEBUG(format, ...) fprintf(stderr, format, __VA_ARGS__)
  1.4970 +#else
  1.4971 +# define DEBUG(format, ...)
  1.4972 +#endif
  1.4973 +
  1.4974 +const char *program_name = NULL;
  1.4975 +
  1.4976 +void * xmalloc (size_t num);
  1.4977 +char * xstrdup (const char *string);
  1.4978 +const char * base_name (const char *name);
  1.4979 +char * find_executable(const char *wrapper);
  1.4980 +int    check_executable(const char *path);
  1.4981 +char * strendzap(char *str, const char *pat);
  1.4982 +void lt_fatal (const char *message, ...);
  1.4983 +
  1.4984 +int
  1.4985 +main (int argc, char *argv[])
  1.4986 +{
  1.4987 +  char **newargz;
  1.4988 +  int i;
  1.4989 +
  1.4990 +  program_name = (char *) xstrdup (base_name (argv[0]));
  1.4991 +  DEBUG("(main) argv[0]      : %s\n",argv[0]);
  1.4992 +  DEBUG("(main) program_name : %s\n",program_name);
  1.4993 +  newargz = XMALLOC(char *, argc+2);
  1.4994 +EOF
  1.4995 +
  1.4996 +            cat >> $cwrappersource <<EOF
  1.4997 +  newargz[0] = (char *) xstrdup("$SHELL");
  1.4998 +EOF
  1.4999 +
  1.5000 +            cat >> $cwrappersource <<"EOF"
  1.5001 +  newargz[1] = find_executable(argv[0]);
  1.5002 +  if (newargz[1] == NULL)
  1.5003 +    lt_fatal("Couldn't find %s", argv[0]);
  1.5004 +  DEBUG("(main) found exe at : %s\n",newargz[1]);
  1.5005 +  /* we know the script has the same name, without the .exe */
  1.5006 +  /* so make sure newargz[1] doesn't end in .exe */
  1.5007 +  strendzap(newargz[1],".exe");
  1.5008 +  for (i = 1; i < argc; i++)
  1.5009 +    newargz[i+1] = xstrdup(argv[i]);
  1.5010 +  newargz[argc+1] = NULL;
  1.5011 +
  1.5012 +  for (i=0; i<argc+1; i++)
  1.5013 +  {
  1.5014 +    DEBUG("(main) newargz[%d]   : %s\n",i,newargz[i]);
  1.5015 +    ;
  1.5016 +  }
  1.5017 +
  1.5018 +EOF
  1.5019 +
  1.5020 +            case $host_os in
  1.5021 +              mingw*)
  1.5022 +                cat >> $cwrappersource <<EOF
  1.5023 +  execv("$SHELL",(char const **)newargz);
  1.5024 +EOF
  1.5025 +              ;;
  1.5026 +              *)
  1.5027 +                cat >> $cwrappersource <<EOF
  1.5028 +  execv("$SHELL",newargz);
  1.5029 +EOF
  1.5030 +              ;;
  1.5031 +            esac
  1.5032 +
  1.5033 +            cat >> $cwrappersource <<"EOF"
  1.5034 +  return 127;
  1.5035 +}
  1.5036 +
  1.5037 +void *
  1.5038 +xmalloc (size_t num)
  1.5039 +{
  1.5040 +  void * p = (void *) malloc (num);
  1.5041 +  if (!p)
  1.5042 +    lt_fatal ("Memory exhausted");
  1.5043 +
  1.5044 +  return p;
  1.5045 +}
  1.5046 +
  1.5047 +char *
  1.5048 +xstrdup (const char *string)
  1.5049 +{
  1.5050 +  return string ? strcpy ((char *) xmalloc (strlen (string) + 1), string) : NULL
  1.5051 +;
  1.5052 +}
  1.5053 +
  1.5054 +const char *
  1.5055 +base_name (const char *name)
  1.5056 +{
  1.5057 +  const char *base;
  1.5058 +
  1.5059 +#if defined (HAVE_DOS_BASED_FILE_SYSTEM)
  1.5060 +  /* Skip over the disk name in MSDOS pathnames. */
  1.5061 +  if (isalpha ((unsigned char)name[0]) && name[1] == ':')
  1.5062 +    name += 2;
  1.5063 +#endif
  1.5064 +
  1.5065 +  for (base = name; *name; name++)
  1.5066 +    if (IS_DIR_SEPARATOR (*name))
  1.5067 +      base = name + 1;
  1.5068 +  return base;
  1.5069 +}
  1.5070 +
  1.5071 +int
  1.5072 +check_executable(const char * path)
  1.5073 +{
  1.5074 +  struct stat st;
  1.5075 +
  1.5076 +  DEBUG("(check_executable)  : %s\n", path ? (*path ? path : "EMPTY!") : "NULL!");
  1.5077 +  if ((!path) || (!*path))
  1.5078 +    return 0;
  1.5079 +
  1.5080 +  if ((stat (path, &st) >= 0) &&
  1.5081 +      (
  1.5082 +        /* MinGW & native WIN32 do not support S_IXOTH or S_IXGRP */
  1.5083 +#if defined (S_IXOTH)
  1.5084 +       ((st.st_mode & S_IXOTH) == S_IXOTH) ||
  1.5085 +#endif
  1.5086 +#if defined (S_IXGRP)
  1.5087 +       ((st.st_mode & S_IXGRP) == S_IXGRP) ||
  1.5088 +#endif
  1.5089 +       ((st.st_mode & S_IXUSR) == S_IXUSR))
  1.5090 +      )
  1.5091 +    return 1;
  1.5092 +  else
  1.5093 +    return 0;
  1.5094 +}
  1.5095 +
  1.5096 +/* Searches for the full path of the wrapper.  Returns
  1.5097 +   newly allocated full path name if found, NULL otherwise */
  1.5098 +char *
  1.5099 +find_executable (const char* wrapper)
  1.5100 +{
  1.5101 +  int has_slash = 0;
  1.5102 +  const char* p;
  1.5103 +  const char* p_next;
  1.5104 +  /* static buffer for getcwd */
  1.5105 +  char tmp[LT_PATHMAX + 1];
  1.5106 +  int tmp_len;
  1.5107 +  char* concat_name;
  1.5108 +
  1.5109 +  DEBUG("(find_executable)  : %s\n", wrapper ? (*wrapper ? wrapper : "EMPTY!") : "NULL!");
  1.5110 +
  1.5111 +  if ((wrapper == NULL) || (*wrapper == '\0'))
  1.5112 +    return NULL;
  1.5113 +
  1.5114 +  /* Absolute path? */
  1.5115 +#if defined (HAVE_DOS_BASED_FILE_SYSTEM)
  1.5116 +  if (isalpha ((unsigned char)wrapper[0]) && wrapper[1] == ':')
  1.5117 +  {
  1.5118 +    concat_name = xstrdup (wrapper);
  1.5119 +    if (check_executable(concat_name))
  1.5120 +      return concat_name;
  1.5121 +    XFREE(concat_name);
  1.5122 +  }
  1.5123 +  else
  1.5124 +  {
  1.5125 +#endif
  1.5126 +    if (IS_DIR_SEPARATOR (wrapper[0]))
  1.5127 +    {
  1.5128 +      concat_name = xstrdup (wrapper);
  1.5129 +      if (check_executable(concat_name))
  1.5130 +        return concat_name;
  1.5131 +      XFREE(concat_name);
  1.5132 +    }
  1.5133 +#if defined (HAVE_DOS_BASED_FILE_SYSTEM)
  1.5134 +  }
  1.5135 +#endif
  1.5136 +
  1.5137 +  for (p = wrapper; *p; p++)
  1.5138 +    if (*p == '/')
  1.5139 +    {
  1.5140 +      has_slash = 1;
  1.5141 +      break;
  1.5142 +    }
  1.5143 +  if (!has_slash)
  1.5144 +  {
  1.5145 +    /* no slashes; search PATH */
  1.5146 +    const char* path = getenv ("PATH");
  1.5147 +    if (path != NULL)
  1.5148 +    {
  1.5149 +      for (p = path; *p; p = p_next)
  1.5150 +      {
  1.5151 +        const char* q;
  1.5152 +        size_t p_len;
  1.5153 +        for (q = p; *q; q++)
  1.5154 +          if (IS_PATH_SEPARATOR(*q))
  1.5155 +            break;
  1.5156 +        p_len = q - p;
  1.5157 +        p_next = (*q == '\0' ? q : q + 1);
  1.5158 +        if (p_len == 0)
  1.5159 +        {
  1.5160 +          /* empty path: current directory */
  1.5161 +          if (getcwd (tmp, LT_PATHMAX) == NULL)
  1.5162 +            lt_fatal ("getcwd failed");
  1.5163 +          tmp_len = strlen(tmp);
  1.5164 +          concat_name = XMALLOC(char, tmp_len + 1 + strlen(wrapper) + 1);
  1.5165 +          memcpy (concat_name, tmp, tmp_len);
  1.5166 +          concat_name[tmp_len] = '/';
  1.5167 +          strcpy (concat_name + tmp_len + 1, wrapper);
  1.5168 +        }
  1.5169 +        else
  1.5170 +        {
  1.5171 +          concat_name = XMALLOC(char, p_len + 1 + strlen(wrapper) + 1);
  1.5172 +          memcpy (concat_name, p, p_len);
  1.5173 +          concat_name[p_len] = '/';
  1.5174 +          strcpy (concat_name + p_len + 1, wrapper);
  1.5175 +        }
  1.5176 +        if (check_executable(concat_name))
  1.5177 +          return concat_name;
  1.5178 +        XFREE(concat_name);
  1.5179 +      }
  1.5180 +    }
  1.5181 +    /* not found in PATH; assume curdir */
  1.5182 +  }
  1.5183 +  /* Relative path | not found in path: prepend cwd */
  1.5184 +  if (getcwd (tmp, LT_PATHMAX) == NULL)
  1.5185 +    lt_fatal ("getcwd failed");
  1.5186 +  tmp_len = strlen(tmp);
  1.5187 +  concat_name = XMALLOC(char, tmp_len + 1 + strlen(wrapper) + 1);
  1.5188 +  memcpy (concat_name, tmp, tmp_len);
  1.5189 +  concat_name[tmp_len] = '/';
  1.5190 +  strcpy (concat_name + tmp_len + 1, wrapper);
  1.5191 +
  1.5192 +  if (check_executable(concat_name))
  1.5193 +    return concat_name;
  1.5194 +  XFREE(concat_name);
  1.5195 +  return NULL;
  1.5196 +}
  1.5197 +
  1.5198 +char *
  1.5199 +strendzap(char *str, const char *pat)
  1.5200 +{
  1.5201 +  size_t len, patlen;
  1.5202 +
  1.5203 +  assert(str != NULL);
  1.5204 +  assert(pat != NULL);
  1.5205 +
  1.5206 +  len = strlen(str);
  1.5207 +  patlen = strlen(pat);
  1.5208 +
  1.5209 +  if (patlen <= len)
  1.5210 +  {
  1.5211 +    str += len - patlen;
  1.5212 +    if (strcmp(str, pat) == 0)
  1.5213 +      *str = '\0';
  1.5214 +  }
  1.5215 +  return str;
  1.5216 +}
  1.5217 +
  1.5218 +static void
  1.5219 +lt_error_core (int exit_status, const char * mode,
  1.5220 +          const char * message, va_list ap)
  1.5221 +{
  1.5222 +  fprintf (stderr, "%s: %s: ", program_name, mode);
  1.5223 +  vfprintf (stderr, message, ap);
  1.5224 +  fprintf (stderr, ".\n");
  1.5225 +
  1.5226 +  if (exit_status >= 0)
  1.5227 +    exit (exit_status);
  1.5228 +}
  1.5229 +
  1.5230 +void
  1.5231 +lt_fatal (const char *message, ...)
  1.5232 +{
  1.5233 +  va_list ap;
  1.5234 +  va_start (ap, message);
  1.5235 +  lt_error_core (EXIT_FAILURE, "FATAL", message, ap);
  1.5236 +  va_end (ap);
  1.5237 +}
  1.5238 +EOF
  1.5239 +          # we should really use a build-platform specific compiler
  1.5240 +          # here, but OTOH, the wrappers (shell script and this C one)
  1.5241 +          # are only useful if you want to execute the "real" binary.
  1.5242 +          # Since the "real" binary is built for $host, then this
  1.5243 +          # wrapper might as well be built for $host, too.
  1.5244 +          $run $LTCC $LTCFLAGS -s -o $cwrapper $cwrappersource
  1.5245 +          ;;
  1.5246 +        esac
  1.5247 +        $rm $output
  1.5248 +        trap "$rm $output; exit $EXIT_FAILURE" 1 2 15
  1.5249 +
  1.5250 +	$echo > $output "\
  1.5251 +#! $SHELL
  1.5252 +
  1.5253 +# $output - temporary wrapper script for $objdir/$outputname
  1.5254 +# Generated by $PROGRAM - GNU $PACKAGE $VERSION$TIMESTAMP
  1.5255 +#
  1.5256 +# The $output program cannot be directly executed until all the libtool
  1.5257 +# libraries that it depends on are installed.
  1.5258 +#
  1.5259 +# This wrapper script should never be moved out of the build directory.
  1.5260 +# If it is, it will not operate correctly.
  1.5261 +
  1.5262 +# Sed substitution that helps us do robust quoting.  It backslashifies
  1.5263 +# metacharacters that are still active within double-quoted strings.
  1.5264 +Xsed='${SED} -e 1s/^X//'
  1.5265 +sed_quote_subst='$sed_quote_subst'
  1.5266 +
  1.5267 +# The HP-UX ksh and POSIX shell print the target directory to stdout
  1.5268 +# if CDPATH is set.
  1.5269 +(unset CDPATH) >/dev/null 2>&1 && unset CDPATH
  1.5270 +
  1.5271 +relink_command=\"$relink_command\"
  1.5272 +
  1.5273 +# This environment variable determines our operation mode.
  1.5274 +if test \"\$libtool_install_magic\" = \"$magic\"; then
  1.5275 +  # install mode needs the following variable:
  1.5276 +  notinst_deplibs='$notinst_deplibs'
  1.5277 +else
  1.5278 +  # When we are sourced in execute mode, \$file and \$echo are already set.
  1.5279 +  if test \"\$libtool_execute_magic\" != \"$magic\"; then
  1.5280 +    echo=\"$qecho\"
  1.5281 +    file=\"\$0\"
  1.5282 +    # Make sure echo works.
  1.5283 +    if test \"X\$1\" = X--no-reexec; then
  1.5284 +      # Discard the --no-reexec flag, and continue.
  1.5285 +      shift
  1.5286 +    elif test \"X\`(\$echo '\t') 2>/dev/null\`\" = 'X\t'; then
  1.5287 +      # Yippee, \$echo works!
  1.5288 +      :
  1.5289 +    else
  1.5290 +      # Restart under the correct shell, and then maybe \$echo will work.
  1.5291 +      exec $SHELL \"\$0\" --no-reexec \${1+\"\$@\"}
  1.5292 +    fi
  1.5293 +  fi\
  1.5294 +"
  1.5295 +	$echo >> $output "\
  1.5296 +
  1.5297 +  # Find the directory that this script lives in.
  1.5298 +  thisdir=\`\$echo \"X\$file\" | \$Xsed -e 's%/[^/]*$%%'\`
  1.5299 +  test \"x\$thisdir\" = \"x\$file\" && thisdir=.
  1.5300 +
  1.5301 +  # Follow symbolic links until we get to the real thisdir.
  1.5302 +  file=\`ls -ld \"\$file\" | ${SED} -n 's/.*-> //p'\`
  1.5303 +  while test -n \"\$file\"; do
  1.5304 +    destdir=\`\$echo \"X\$file\" | \$Xsed -e 's%/[^/]*\$%%'\`
  1.5305 +
  1.5306 +    # If there was a directory component, then change thisdir.
  1.5307 +    if test \"x\$destdir\" != \"x\$file\"; then
  1.5308 +      case \"\$destdir\" in
  1.5309 +      [\\\\/]* | [A-Za-z]:[\\\\/]*) thisdir=\"\$destdir\" ;;
  1.5310 +      *) thisdir=\"\$thisdir/\$destdir\" ;;
  1.5311 +      esac
  1.5312 +    fi
  1.5313 +
  1.5314 +    file=\`\$echo \"X\$file\" | \$Xsed -e 's%^.*/%%'\`
  1.5315 +    file=\`ls -ld \"\$thisdir/\$file\" | ${SED} -n 's/.*-> //p'\`
  1.5316 +  done
  1.5317 +
  1.5318 +  # Try to get the absolute directory name.
  1.5319 +  absdir=\`cd \"\$thisdir\" && pwd\`
  1.5320 +  test -n \"\$absdir\" && thisdir=\"\$absdir\"
  1.5321 +"
  1.5322 +
  1.5323 +	if test "$fast_install" = yes; then
  1.5324 +	  $echo >> $output "\
  1.5325 +  program=lt-'$outputname'$exeext
  1.5326 +  progdir=\"\$thisdir/$objdir\"
  1.5327 +
  1.5328 +  if test ! -f \"\$progdir/\$program\" || \\
  1.5329 +     { file=\`ls -1dt \"\$progdir/\$program\" \"\$progdir/../\$program\" 2>/dev/null | ${SED} 1q\`; \\
  1.5330 +       test \"X\$file\" != \"X\$progdir/\$program\"; }; then
  1.5331 +
  1.5332 +    file=\"\$\$-\$program\"
  1.5333 +
  1.5334 +    if test ! -d \"\$progdir\"; then
  1.5335 +      $mkdir \"\$progdir\"
  1.5336 +    else
  1.5337 +      $rm \"\$progdir/\$file\"
  1.5338 +    fi"
  1.5339 +
  1.5340 +	  $echo >> $output "\
  1.5341 +
  1.5342 +    # relink executable if necessary
  1.5343 +    if test -n \"\$relink_command\"; then
  1.5344 +      if relink_command_output=\`eval \$relink_command 2>&1\`; then :
  1.5345 +      else
  1.5346 +	$echo \"\$relink_command_output\" >&2
  1.5347 +	$rm \"\$progdir/\$file\"
  1.5348 +	exit $EXIT_FAILURE
  1.5349 +      fi
  1.5350 +    fi
  1.5351 +
  1.5352 +    $mv \"\$progdir/\$file\" \"\$progdir/\$program\" 2>/dev/null ||
  1.5353 +    { $rm \"\$progdir/\$program\";
  1.5354 +      $mv \"\$progdir/\$file\" \"\$progdir/\$program\"; }
  1.5355 +    $rm \"\$progdir/\$file\"
  1.5356 +  fi"
  1.5357 +	else
  1.5358 +	  $echo >> $output "\
  1.5359 +  program='$outputname'
  1.5360 +  progdir=\"\$thisdir/$objdir\"
  1.5361 +"
  1.5362 +	fi
  1.5363 +
  1.5364 +	$echo >> $output "\
  1.5365 +
  1.5366 +  if test -f \"\$progdir/\$program\"; then"
  1.5367 +
  1.5368 +	# Export our shlibpath_var if we have one.
  1.5369 +	if test "$shlibpath_overrides_runpath" = yes && test -n "$shlibpath_var" && test -n "$temp_rpath"; then
  1.5370 +	  $echo >> $output "\
  1.5371 +    # Add our own library path to $shlibpath_var
  1.5372 +    $shlibpath_var=\"$temp_rpath\$$shlibpath_var\"
  1.5373 +
  1.5374 +    # Some systems cannot cope with colon-terminated $shlibpath_var
  1.5375 +    # The second colon is a workaround for a bug in BeOS R4 sed
  1.5376 +    $shlibpath_var=\`\$echo \"X\$$shlibpath_var\" | \$Xsed -e 's/::*\$//'\`
  1.5377 +
  1.5378 +    export $shlibpath_var
  1.5379 +"
  1.5380 +	fi
  1.5381 +
  1.5382 +	# fixup the dll searchpath if we need to.
  1.5383 +	if test -n "$dllsearchpath"; then
  1.5384 +	  $echo >> $output "\
  1.5385 +    # Add the dll search path components to the executable PATH
  1.5386 +    PATH=$dllsearchpath:\$PATH
  1.5387 +"
  1.5388 +	fi
  1.5389 +
  1.5390 +	$echo >> $output "\
  1.5391 +    if test \"\$libtool_execute_magic\" != \"$magic\"; then
  1.5392 +      # Run the actual program with our arguments.
  1.5393 +"
  1.5394 +	case $host in
  1.5395 +	# Backslashes separate directories on plain windows
  1.5396 +	*-*-mingw | *-*-os2*)
  1.5397 +	  $echo >> $output "\
  1.5398 +      exec \"\$progdir\\\\\$program\" \${1+\"\$@\"}
  1.5399 +"
  1.5400 +	  ;;
  1.5401 +
  1.5402 +	*)
  1.5403 +	  $echo >> $output "\
  1.5404 +      exec \"\$progdir/\$program\" \${1+\"\$@\"}
  1.5405 +"
  1.5406 +	  ;;
  1.5407 +	esac
  1.5408 +	$echo >> $output "\
  1.5409 +      \$echo \"\$0: cannot exec \$program \${1+\"\$@\"}\"
  1.5410 +      exit $EXIT_FAILURE
  1.5411 +    fi
  1.5412 +  else
  1.5413 +    # The program doesn't exist.
  1.5414 +    \$echo \"\$0: error: \\\`\$progdir/\$program' does not exist\" 1>&2
  1.5415 +    \$echo \"This script is just a wrapper for \$program.\" 1>&2
  1.5416 +    $echo \"See the $PACKAGE documentation for more information.\" 1>&2
  1.5417 +    exit $EXIT_FAILURE
  1.5418 +  fi
  1.5419 +fi\
  1.5420 +"
  1.5421 +	chmod +x $output
  1.5422 +      fi
  1.5423 +      exit $EXIT_SUCCESS
  1.5424 +      ;;
  1.5425 +    esac
  1.5426 +
  1.5427 +    # See if we need to build an old-fashioned archive.
  1.5428 +    for oldlib in $oldlibs; do
  1.5429 +
  1.5430 +      if test "$build_libtool_libs" = convenience; then
  1.5431 +	oldobjs="$libobjs_save"
  1.5432 +	addlibs="$convenience"
  1.5433 +	build_libtool_libs=no
  1.5434 +      else
  1.5435 +	if test "$build_libtool_libs" = module; then
  1.5436 +	  oldobjs="$libobjs_save"
  1.5437 +	  build_libtool_libs=no
  1.5438 +	else
  1.5439 +	  oldobjs="$old_deplibs $non_pic_objects"
  1.5440 +	fi
  1.5441 +	addlibs="$old_convenience"
  1.5442 +      fi
  1.5443 +
  1.5444 +      if test -n "$addlibs"; then
  1.5445 +	gentop="$output_objdir/${outputname}x"
  1.5446 +	generated="$generated $gentop"
  1.5447 +
  1.5448 +	func_extract_archives $gentop $addlibs
  1.5449 +	oldobjs="$oldobjs $func_extract_archives_result"
  1.5450 +      fi
  1.5451 +
  1.5452 +      # Do each command in the archive commands.
  1.5453 +      if test -n "$old_archive_from_new_cmds" && test "$build_libtool_libs" = yes; then
  1.5454 +       cmds=$old_archive_from_new_cmds
  1.5455 +      else
  1.5456 +	# POSIX demands no paths to be encoded in archives.  We have
  1.5457 +	# to avoid creating archives with duplicate basenames if we
  1.5458 +	# might have to extract them afterwards, e.g., when creating a
  1.5459 +	# static archive out of a convenience library, or when linking
  1.5460 +	# the entirety of a libtool archive into another (currently
  1.5461 +	# not supported by libtool).
  1.5462 +	if (for obj in $oldobjs
  1.5463 +	    do
  1.5464 +	      $echo "X$obj" | $Xsed -e 's%^.*/%%'
  1.5465 +	    done | sort | sort -uc >/dev/null 2>&1); then
  1.5466 +	  :
  1.5467 +	else
  1.5468 +	  $echo "copying selected object files to avoid basename conflicts..."
  1.5469 +
  1.5470 +	  if test -z "$gentop"; then
  1.5471 +	    gentop="$output_objdir/${outputname}x"
  1.5472 +	    generated="$generated $gentop"
  1.5473 +
  1.5474 +	    $show "${rm}r $gentop"
  1.5475 +	    $run ${rm}r "$gentop"
  1.5476 +	    $show "$mkdir $gentop"
  1.5477 +	    $run $mkdir "$gentop"
  1.5478 +	    exit_status=$?
  1.5479 +	    if test "$exit_status" -ne 0 && test ! -d "$gentop"; then
  1.5480 +	      exit $exit_status
  1.5481 +	    fi
  1.5482 +	  fi
  1.5483 +
  1.5484 +	  save_oldobjs=$oldobjs
  1.5485 +	  oldobjs=
  1.5486 +	  counter=1
  1.5487 +	  for obj in $save_oldobjs
  1.5488 +	  do
  1.5489 +	    objbase=`$echo "X$obj" | $Xsed -e 's%^.*/%%'`
  1.5490 +	    case " $oldobjs " in
  1.5491 +	    " ") oldobjs=$obj ;;
  1.5492 +	    *[\ /]"$objbase "*)
  1.5493 +	      while :; do
  1.5494 +		# Make sure we don't pick an alternate name that also
  1.5495 +		# overlaps.
  1.5496 +		newobj=lt$counter-$objbase
  1.5497 +		counter=`expr $counter + 1`
  1.5498 +		case " $oldobjs " in
  1.5499 +		*[\ /]"$newobj "*) ;;
  1.5500 +		*) if test ! -f "$gentop/$newobj"; then break; fi ;;
  1.5501 +		esac
  1.5502 +	      done
  1.5503 +	      $show "ln $obj $gentop/$newobj || cp $obj $gentop/$newobj"
  1.5504 +	      $run ln "$obj" "$gentop/$newobj" ||
  1.5505 +	      $run cp "$obj" "$gentop/$newobj"
  1.5506 +	      oldobjs="$oldobjs $gentop/$newobj"
  1.5507 +	      ;;
  1.5508 +	    *) oldobjs="$oldobjs $obj" ;;
  1.5509 +	    esac
  1.5510 +	  done
  1.5511 +	fi
  1.5512 +
  1.5513 +	eval cmds=\"$old_archive_cmds\"
  1.5514 +
  1.5515 +	if len=`expr "X$cmds" : ".*"` &&
  1.5516 +	     test "$len" -le "$max_cmd_len" || test "$max_cmd_len" -le -1; then
  1.5517 +	  cmds=$old_archive_cmds
  1.5518 +	else
  1.5519 +	  # the command line is too long to link in one step, link in parts
  1.5520 +	  $echo "using piecewise archive linking..."
  1.5521 +	  save_RANLIB=$RANLIB
  1.5522 +	  RANLIB=:
  1.5523 +	  objlist=
  1.5524 +	  concat_cmds=
  1.5525 +	  save_oldobjs=$oldobjs
  1.5526 +
  1.5527 +	  # Is there a better way of finding the last object in the list?
  1.5528 +	  for obj in $save_oldobjs
  1.5529 +	  do
  1.5530 +	    last_oldobj=$obj
  1.5531 +	  done
  1.5532 +	  for obj in $save_oldobjs
  1.5533 +	  do
  1.5534 +	    oldobjs="$objlist $obj"
  1.5535 +	    objlist="$objlist $obj"
  1.5536 +	    eval test_cmds=\"$old_archive_cmds\"
  1.5537 +	    if len=`expr "X$test_cmds" : ".*" 2>/dev/null` &&
  1.5538 +	       test "$len" -le "$max_cmd_len"; then
  1.5539 +	      :
  1.5540 +	    else
  1.5541 +	      # the above command should be used before it gets too long
  1.5542 +	      oldobjs=$objlist
  1.5543 +	      if test "$obj" = "$last_oldobj" ; then
  1.5544 +	        RANLIB=$save_RANLIB
  1.5545 +	      fi
  1.5546 +	      test -z "$concat_cmds" || concat_cmds=$concat_cmds~
  1.5547 +	      eval concat_cmds=\"\${concat_cmds}$old_archive_cmds\"
  1.5548 +	      objlist=
  1.5549 +	    fi
  1.5550 +	  done
  1.5551 +	  RANLIB=$save_RANLIB
  1.5552 +	  oldobjs=$objlist
  1.5553 +	  if test "X$oldobjs" = "X" ; then
  1.5554 +	    eval cmds=\"\$concat_cmds\"
  1.5555 +	  else
  1.5556 +	    eval cmds=\"\$concat_cmds~\$old_archive_cmds\"
  1.5557 +	  fi
  1.5558 +	fi
  1.5559 +      fi
  1.5560 +      save_ifs="$IFS"; IFS='~'
  1.5561 +      for cmd in $cmds; do
  1.5562 +        eval cmd=\"$cmd\"
  1.5563 +	IFS="$save_ifs"
  1.5564 +	$show "$cmd"
  1.5565 +	$run eval "$cmd" || exit $?
  1.5566 +      done
  1.5567 +      IFS="$save_ifs"
  1.5568 +    done
  1.5569 +
  1.5570 +    if test -n "$generated"; then
  1.5571 +      $show "${rm}r$generated"
  1.5572 +      $run ${rm}r$generated
  1.5573 +    fi
  1.5574 +
  1.5575 +    # Now create the libtool archive.
  1.5576 +    case $output in
  1.5577 +    *.la)
  1.5578 +      old_library=
  1.5579 +      test "$build_old_libs" = yes && old_library="$libname.$libext"
  1.5580 +      $show "creating $output"
  1.5581 +
  1.5582 +      # Preserve any variables that may affect compiler behavior
  1.5583 +      for var in $variables_saved_for_relink; do
  1.5584 +	if eval test -z \"\${$var+set}\"; then
  1.5585 +	  relink_command="{ test -z \"\${$var+set}\" || unset $var || { $var=; export $var; }; }; $relink_command"
  1.5586 +	elif eval var_value=\$$var; test -z "$var_value"; then
  1.5587 +	  relink_command="$var=; export $var; $relink_command"
  1.5588 +	else
  1.5589 +	  var_value=`$echo "X$var_value" | $Xsed -e "$sed_quote_subst"`
  1.5590 +	  relink_command="$var=\"$var_value\"; export $var; $relink_command"
  1.5591 +	fi
  1.5592 +      done
  1.5593 +      # Quote the link command for shipping.
  1.5594 +      relink_command="(cd `pwd`; $SHELL $progpath $preserve_args --mode=relink $libtool_args @inst_prefix_dir@)"
  1.5595 +      relink_command=`$echo "X$relink_command" | $Xsed -e "$sed_quote_subst"`
  1.5596 +      if test "$hardcode_automatic" = yes ; then
  1.5597 +	relink_command=
  1.5598 +      fi
  1.5599 +
  1.5600 +
  1.5601 +      # Only create the output if not a dry run.
  1.5602 +      if test -z "$run"; then
  1.5603 +	for installed in no yes; do
  1.5604 +	  if test "$installed" = yes; then
  1.5605 +	    if test -z "$install_libdir"; then
  1.5606 +	      break
  1.5607 +	    fi
  1.5608 +	    output="$output_objdir/$outputname"i
  1.5609 +	    # Replace all uninstalled libtool libraries with the installed ones
  1.5610 +	    newdependency_libs=
  1.5611 +	    for deplib in $dependency_libs; do
  1.5612 +	      case $deplib in
  1.5613 +	      *.la)
  1.5614 +		name=`$echo "X$deplib" | $Xsed -e 's%^.*/%%'`
  1.5615 +		eval libdir=`${SED} -n -e 's/^libdir=\(.*\)$/\1/p' $deplib`
  1.5616 +		if test -z "$libdir"; then
  1.5617 +		  $echo "$modename: \`$deplib' is not a valid libtool archive" 1>&2
  1.5618 +		  exit $EXIT_FAILURE
  1.5619 +		fi
  1.5620 +		newdependency_libs="$newdependency_libs $libdir/$name"
  1.5621 +		;;
  1.5622 +	      *) newdependency_libs="$newdependency_libs $deplib" ;;
  1.5623 +	      esac
  1.5624 +	    done
  1.5625 +	    dependency_libs="$newdependency_libs"
  1.5626 +	    newdlfiles=
  1.5627 +	    for lib in $dlfiles; do
  1.5628 +	      name=`$echo "X$lib" | $Xsed -e 's%^.*/%%'`
  1.5629 +	      eval libdir=`${SED} -n -e 's/^libdir=\(.*\)$/\1/p' $lib`
  1.5630 +	      if test -z "$libdir"; then
  1.5631 +		$echo "$modename: \`$lib' is not a valid libtool archive" 1>&2
  1.5632 +		exit $EXIT_FAILURE
  1.5633 +	      fi
  1.5634 +	      newdlfiles="$newdlfiles $libdir/$name"
  1.5635 +	    done
  1.5636 +	    dlfiles="$newdlfiles"
  1.5637 +	    newdlprefiles=
  1.5638 +	    for lib in $dlprefiles; do
  1.5639 +	      name=`$echo "X$lib" | $Xsed -e 's%^.*/%%'`
  1.5640 +	      eval libdir=`${SED} -n -e 's/^libdir=\(.*\)$/\1/p' $lib`
  1.5641 +	      if test -z "$libdir"; then
  1.5642 +		$echo "$modename: \`$lib' is not a valid libtool archive" 1>&2
  1.5643 +		exit $EXIT_FAILURE
  1.5644 +	      fi
  1.5645 +	      newdlprefiles="$newdlprefiles $libdir/$name"
  1.5646 +	    done
  1.5647 +	    dlprefiles="$newdlprefiles"
  1.5648 +	  else
  1.5649 +	    newdlfiles=
  1.5650 +	    for lib in $dlfiles; do
  1.5651 +	      case $lib in
  1.5652 +		[\\/]* | [A-Za-z]:[\\/]*) abs="$lib" ;;
  1.5653 +		*) abs=`pwd`"/$lib" ;;
  1.5654 +	      esac
  1.5655 +	      newdlfiles="$newdlfiles $abs"
  1.5656 +	    done
  1.5657 +	    dlfiles="$newdlfiles"
  1.5658 +	    newdlprefiles=
  1.5659 +	    for lib in $dlprefiles; do
  1.5660 +	      case $lib in
  1.5661 +		[\\/]* | [A-Za-z]:[\\/]*) abs="$lib" ;;
  1.5662 +		*) abs=`pwd`"/$lib" ;;
  1.5663 +	      esac
  1.5664 +	      newdlprefiles="$newdlprefiles $abs"
  1.5665 +	    done
  1.5666 +	    dlprefiles="$newdlprefiles"
  1.5667 +	  fi
  1.5668 +	  $rm $output
  1.5669 +	  # place dlname in correct position for cygwin
  1.5670 +	  tdlname=$dlname
  1.5671 +	  case $host,$output,$installed,$module,$dlname in
  1.5672 +	    *cygwin*,*lai,yes,no,*.dll | *mingw*,*lai,yes,no,*.dll) tdlname=../bin/$dlname ;;
  1.5673 +	  esac
  1.5674 +	  $echo > $output "\
  1.5675 +# $outputname - a libtool library file
  1.5676 +# Generated by $PROGRAM - GNU $PACKAGE $VERSION$TIMESTAMP
  1.5677 +#
  1.5678 +# Please DO NOT delete this file!
  1.5679 +# It is necessary for linking the library.
  1.5680 +
  1.5681 +# The name that we can dlopen(3).
  1.5682 +dlname='$tdlname'
  1.5683 +
  1.5684 +# Names of this library.
  1.5685 +library_names='$library_names'
  1.5686 +
  1.5687 +# The name of the static archive.
  1.5688 +old_library='$old_library'
  1.5689 +
  1.5690 +# Libraries that this one depends upon.
  1.5691 +dependency_libs='$dependency_libs'
  1.5692 +
  1.5693 +# Version information for $libname.
  1.5694 +current=$current
  1.5695 +age=$age
  1.5696 +revision=$revision
  1.5697 +
  1.5698 +# Is this an already installed library?
  1.5699 +installed=$installed
  1.5700 +
  1.5701 +# Should we warn about portability when linking against -modules?
  1.5702 +shouldnotlink=$module
  1.5703 +
  1.5704 +# Files to dlopen/dlpreopen
  1.5705 +dlopen='$dlfiles'
  1.5706 +dlpreopen='$dlprefiles'
  1.5707 +
  1.5708 +# Directory that this library needs to be installed in:
  1.5709 +libdir='$install_libdir'"
  1.5710 +	  if test "$installed" = no && test "$need_relink" = yes; then
  1.5711 +	    $echo >> $output "\
  1.5712 +relink_command=\"$relink_command\""
  1.5713 +	  fi
  1.5714 +	done
  1.5715 +      fi
  1.5716 +
  1.5717 +      # Do a symbolic link so that the libtool archive can be found in
  1.5718 +      # LD_LIBRARY_PATH before the program is installed.
  1.5719 +      $show "(cd $output_objdir && $rm $outputname && $LN_S ../$outputname $outputname)"
  1.5720 +      $run eval '(cd $output_objdir && $rm $outputname && $LN_S ../$outputname $outputname)' || exit $?
  1.5721 +      ;;
  1.5722 +    esac
  1.5723 +    exit $EXIT_SUCCESS
  1.5724 +    ;;
  1.5725 +
  1.5726 +  # libtool install mode
  1.5727 +  install)
  1.5728 +    modename="$modename: install"
  1.5729 +
  1.5730 +    # There may be an optional sh(1) argument at the beginning of
  1.5731 +    # install_prog (especially on Windows NT).
  1.5732 +    if test "$nonopt" = "$SHELL" || test "$nonopt" = /bin/sh ||
  1.5733 +       # Allow the use of GNU shtool's install command.
  1.5734 +       $echo "X$nonopt" | grep shtool > /dev/null; then
  1.5735 +      # Aesthetically quote it.
  1.5736 +      arg=`$echo "X$nonopt" | $Xsed -e "$sed_quote_subst"`
  1.5737 +      case $arg in
  1.5738 +      *[\[\~\#\^\&\*\(\)\{\}\|\;\<\>\?\'\ \	]*|*]*|"")
  1.5739 +	arg="\"$arg\""
  1.5740 +	;;
  1.5741 +      esac
  1.5742 +      install_prog="$arg "
  1.5743 +      arg="$1"
  1.5744 +      shift
  1.5745 +    else
  1.5746 +      install_prog=
  1.5747 +      arg=$nonopt
  1.5748 +    fi
  1.5749 +
  1.5750 +    # The real first argument should be the name of the installation program.
  1.5751 +    # Aesthetically quote it.
  1.5752 +    arg=`$echo "X$arg" | $Xsed -e "$sed_quote_subst"`
  1.5753 +    case $arg in
  1.5754 +    *[\[\~\#\^\&\*\(\)\{\}\|\;\<\>\?\'\ \	]*|*]*|"")
  1.5755 +      arg="\"$arg\""
  1.5756 +      ;;
  1.5757 +    esac
  1.5758 +    install_prog="$install_prog$arg"
  1.5759 +
  1.5760 +    # We need to accept at least all the BSD install flags.
  1.5761 +    dest=
  1.5762 +    files=
  1.5763 +    opts=
  1.5764 +    prev=
  1.5765 +    install_type=
  1.5766 +    isdir=no
  1.5767 +    stripme=
  1.5768 +    for arg
  1.5769 +    do
  1.5770 +      if test -n "$dest"; then
  1.5771 +	files="$files $dest"
  1.5772 +	dest=$arg
  1.5773 +	continue
  1.5774 +      fi
  1.5775 +
  1.5776 +      case $arg in
  1.5777 +      -d) isdir=yes ;;
  1.5778 +      -f) 
  1.5779 +      	case " $install_prog " in
  1.5780 +	*[\\\ /]cp\ *) ;;
  1.5781 +	*) prev=$arg ;;
  1.5782 +	esac
  1.5783 +	;;
  1.5784 +      -g | -m | -o) prev=$arg ;;
  1.5785 +      -s)
  1.5786 +	stripme=" -s"
  1.5787 +	continue
  1.5788 +	;;
  1.5789 +      -*)
  1.5790 +	;;
  1.5791 +      *)
  1.5792 +	# If the previous option needed an argument, then skip it.
  1.5793 +	if test -n "$prev"; then
  1.5794 +	  prev=
  1.5795 +	else
  1.5796 +	  dest=$arg
  1.5797 +	  continue
  1.5798 +	fi
  1.5799 +	;;
  1.5800 +      esac
  1.5801 +
  1.5802 +      # Aesthetically quote the argument.
  1.5803 +      arg=`$echo "X$arg" | $Xsed -e "$sed_quote_subst"`
  1.5804 +      case $arg in
  1.5805 +      *[\[\~\#\^\&\*\(\)\{\}\|\;\<\>\?\'\ \	]*|*]*|"")
  1.5806 +	arg="\"$arg\""
  1.5807 +	;;
  1.5808 +      esac
  1.5809 +      install_prog="$install_prog $arg"
  1.5810 +    done
  1.5811 +
  1.5812 +    if test -z "$install_prog"; then
  1.5813 +      $echo "$modename: you must specify an install program" 1>&2
  1.5814 +      $echo "$help" 1>&2
  1.5815 +      exit $EXIT_FAILURE
  1.5816 +    fi
  1.5817 +
  1.5818 +    if test -n "$prev"; then
  1.5819 +      $echo "$modename: the \`$prev' option requires an argument" 1>&2
  1.5820 +      $echo "$help" 1>&2
  1.5821 +      exit $EXIT_FAILURE
  1.5822 +    fi
  1.5823 +
  1.5824 +    if test -z "$files"; then
  1.5825 +      if test -z "$dest"; then
  1.5826 +	$echo "$modename: no file or destination specified" 1>&2
  1.5827 +      else
  1.5828 +	$echo "$modename: you must specify a destination" 1>&2
  1.5829 +      fi
  1.5830 +      $echo "$help" 1>&2
  1.5831 +      exit $EXIT_FAILURE
  1.5832 +    fi
  1.5833 +
  1.5834 +    # Strip any trailing slash from the destination.
  1.5835 +    dest=`$echo "X$dest" | $Xsed -e 's%/$%%'`
  1.5836 +
  1.5837 +    # Check to see that the destination is a directory.
  1.5838 +    test -d "$dest" && isdir=yes
  1.5839 +    if test "$isdir" = yes; then
  1.5840 +      destdir="$dest"
  1.5841 +      destname=
  1.5842 +    else
  1.5843 +      destdir=`$echo "X$dest" | $Xsed -e 's%/[^/]*$%%'`
  1.5844 +      test "X$destdir" = "X$dest" && destdir=.
  1.5845 +      destname=`$echo "X$dest" | $Xsed -e 's%^.*/%%'`
  1.5846 +
  1.5847 +      # Not a directory, so check to see that there is only one file specified.
  1.5848 +      set dummy $files
  1.5849 +      if test "$#" -gt 2; then
  1.5850 +	$echo "$modename: \`$dest' is not a directory" 1>&2
  1.5851 +	$echo "$help" 1>&2
  1.5852 +	exit $EXIT_FAILURE
  1.5853 +      fi
  1.5854 +    fi
  1.5855 +    case $destdir in
  1.5856 +    [\\/]* | [A-Za-z]:[\\/]*) ;;
  1.5857 +    *)
  1.5858 +      for file in $files; do
  1.5859 +	case $file in
  1.5860 +	*.lo) ;;
  1.5861 +	*)
  1.5862 +	  $echo "$modename: \`$destdir' must be an absolute directory name" 1>&2
  1.5863 +	  $echo "$help" 1>&2
  1.5864 +	  exit $EXIT_FAILURE
  1.5865 +	  ;;
  1.5866 +	esac
  1.5867 +      done
  1.5868 +      ;;
  1.5869 +    esac
  1.5870 +
  1.5871 +    # This variable tells wrapper scripts just to set variables rather
  1.5872 +    # than running their programs.
  1.5873 +    libtool_install_magic="$magic"
  1.5874 +
  1.5875 +    staticlibs=
  1.5876 +    future_libdirs=
  1.5877 +    current_libdirs=
  1.5878 +    for file in $files; do
  1.5879 +
  1.5880 +      # Do each installation.
  1.5881 +      case $file in
  1.5882 +      *.$libext)
  1.5883 +	# Do the static libraries later.
  1.5884 +	staticlibs="$staticlibs $file"
  1.5885 +	;;
  1.5886 +
  1.5887 +      *.la)
  1.5888 +	# Check to see that this really is a libtool archive.
  1.5889 +	if (${SED} -e '2q' $file | grep "^# Generated by .*$PACKAGE") >/dev/null 2>&1; then :
  1.5890 +	else
  1.5891 +	  $echo "$modename: \`$file' is not a valid libtool archive" 1>&2
  1.5892 +	  $echo "$help" 1>&2
  1.5893 +	  exit $EXIT_FAILURE
  1.5894 +	fi
  1.5895 +
  1.5896 +	library_names=
  1.5897 +	old_library=
  1.5898 +	relink_command=
  1.5899 +	# If there is no directory component, then add one.
  1.5900 +	case $file in
  1.5901 +	*/* | *\\*) . $file ;;
  1.5902 +	*) . ./$file ;;
  1.5903 +	esac
  1.5904 +
  1.5905 +	# Add the libdir to current_libdirs if it is the destination.
  1.5906 +	if test "X$destdir" = "X$libdir"; then
  1.5907 +	  case "$current_libdirs " in
  1.5908 +	  *" $libdir "*) ;;
  1.5909 +	  *) current_libdirs="$current_libdirs $libdir" ;;
  1.5910 +	  esac
  1.5911 +	else
  1.5912 +	  # Note the libdir as a future libdir.
  1.5913 +	  case "$future_libdirs " in
  1.5914 +	  *" $libdir "*) ;;
  1.5915 +	  *) future_libdirs="$future_libdirs $libdir" ;;
  1.5916 +	  esac
  1.5917 +	fi
  1.5918 +
  1.5919 +	dir=`$echo "X$file" | $Xsed -e 's%/[^/]*$%%'`/
  1.5920 +	test "X$dir" = "X$file/" && dir=
  1.5921 +	dir="$dir$objdir"
  1.5922 +
  1.5923 +	if test -n "$relink_command"; then
  1.5924 +	  # Determine the prefix the user has applied to our future dir.
  1.5925 +	  inst_prefix_dir=`$echo "$destdir" | $SED "s%$libdir\$%%"`
  1.5926 +
  1.5927 +	  # Don't allow the user to place us outside of our expected
  1.5928 +	  # location b/c this prevents finding dependent libraries that
  1.5929 +	  # are installed to the same prefix.
  1.5930 +	  # At present, this check doesn't affect windows .dll's that
  1.5931 +	  # are installed into $libdir/../bin (currently, that works fine)
  1.5932 +	  # but it's something to keep an eye on.
  1.5933 +	  if test "$inst_prefix_dir" = "$destdir"; then
  1.5934 +	    $echo "$modename: error: cannot install \`$file' to a directory not ending in $libdir" 1>&2
  1.5935 +	    exit $EXIT_FAILURE
  1.5936 +	  fi
  1.5937 +
  1.5938 +	  if test -n "$inst_prefix_dir"; then
  1.5939 +	    # Stick the inst_prefix_dir data into the link command.
  1.5940 +	    relink_command=`$echo "$relink_command" | $SED "s%@inst_prefix_dir@%-inst-prefix-dir $inst_prefix_dir%"`
  1.5941 +	  else
  1.5942 +	    relink_command=`$echo "$relink_command" | $SED "s%@inst_prefix_dir@%%"`
  1.5943 +	  fi
  1.5944 +
  1.5945 +	  $echo "$modename: warning: relinking \`$file'" 1>&2
  1.5946 +	  $show "$relink_command"
  1.5947 +	  if $run eval "$relink_command"; then :
  1.5948 +	  else
  1.5949 +	    $echo "$modename: error: relink \`$file' with the above command before installing it" 1>&2
  1.5950 +	    exit $EXIT_FAILURE
  1.5951 +	  fi
  1.5952 +	fi
  1.5953 +
  1.5954 +	# See the names of the shared library.
  1.5955 +	set dummy $library_names
  1.5956 +	if test -n "$2"; then
  1.5957 +	  realname="$2"
  1.5958 +	  shift
  1.5959 +	  shift
  1.5960 +
  1.5961 +	  srcname="$realname"
  1.5962 +	  test -n "$relink_command" && srcname="$realname"T
  1.5963 +
  1.5964 +	  # Install the shared library and build the symlinks.
  1.5965 +	  $show "$install_prog $dir/$srcname $destdir/$realname"
  1.5966 +	  $run eval "$install_prog $dir/$srcname $destdir/$realname" || exit $?
  1.5967 +	  if test -n "$stripme" && test -n "$striplib"; then
  1.5968 +	    $show "$striplib $destdir/$realname"
  1.5969 +	    $run eval "$striplib $destdir/$realname" || exit $?
  1.5970 +	  fi
  1.5971 +
  1.5972 +	  if test "$#" -gt 0; then
  1.5973 +	    # Delete the old symlinks, and create new ones.
  1.5974 +	    # Try `ln -sf' first, because the `ln' binary might depend on
  1.5975 +	    # the symlink we replace!  Solaris /bin/ln does not understand -f,
  1.5976 +	    # so we also need to try rm && ln -s.
  1.5977 +	    for linkname
  1.5978 +	    do
  1.5979 +	      if test "$linkname" != "$realname"; then
  1.5980 +                $show "(cd $destdir && { $LN_S -f $realname $linkname || { $rm $linkname && $LN_S $realname $linkname; }; })"
  1.5981 +                $run eval "(cd $destdir && { $LN_S -f $realname $linkname || { $rm $linkname && $LN_S $realname $linkname; }; })"
  1.5982 +	      fi
  1.5983 +	    done
  1.5984 +	  fi
  1.5985 +
  1.5986 +	  # Do each command in the postinstall commands.
  1.5987 +	  lib="$destdir/$realname"
  1.5988 +	  cmds=$postinstall_cmds
  1.5989 +	  save_ifs="$IFS"; IFS='~'
  1.5990 +	  for cmd in $cmds; do
  1.5991 +	    IFS="$save_ifs"
  1.5992 +	    eval cmd=\"$cmd\"
  1.5993 +	    $show "$cmd"
  1.5994 +	    $run eval "$cmd" || {
  1.5995 +	      lt_exit=$?
  1.5996 +
  1.5997 +	      # Restore the uninstalled library and exit
  1.5998 +	      if test "$mode" = relink; then
  1.5999 +		$run eval '(cd $output_objdir && $rm ${realname}T && $mv ${realname}U $realname)'
  1.6000 +	      fi
  1.6001 +
  1.6002 +	      exit $lt_exit
  1.6003 +	    }
  1.6004 +	  done
  1.6005 +	  IFS="$save_ifs"
  1.6006 +	fi
  1.6007 +
  1.6008 +	# Install the pseudo-library for information purposes.
  1.6009 +	name=`$echo "X$file" | $Xsed -e 's%^.*/%%'`
  1.6010 +	instname="$dir/$name"i
  1.6011 +	$show "$install_prog $instname $destdir/$name"
  1.6012 +	$run eval "$install_prog $instname $destdir/$name" || exit $?
  1.6013 +
  1.6014 +	# Maybe install the static library, too.
  1.6015 +	test -n "$old_library" && staticlibs="$staticlibs $dir/$old_library"
  1.6016 +	;;
  1.6017 +
  1.6018 +      *.lo)
  1.6019 +	# Install (i.e. copy) a libtool object.
  1.6020 +
  1.6021 +	# Figure out destination file name, if it wasn't already specified.
  1.6022 +	if test -n "$destname"; then
  1.6023 +	  destfile="$destdir/$destname"
  1.6024 +	else
  1.6025 +	  destfile=`$echo "X$file" | $Xsed -e 's%^.*/%%'`
  1.6026 +	  destfile="$destdir/$destfile"
  1.6027 +	fi
  1.6028 +
  1.6029 +	# Deduce the name of the destination old-style object file.
  1.6030 +	case $destfile in
  1.6031 +	*.lo)
  1.6032 +	  staticdest=`$echo "X$destfile" | $Xsed -e "$lo2o"`
  1.6033 +	  ;;
  1.6034 +	*.$objext)
  1.6035 +	  staticdest="$destfile"
  1.6036 +	  destfile=
  1.6037 +	  ;;
  1.6038 +	*)
  1.6039 +	  $echo "$modename: cannot copy a libtool object to \`$destfile'" 1>&2
  1.6040 +	  $echo "$help" 1>&2
  1.6041 +	  exit $EXIT_FAILURE
  1.6042 +	  ;;
  1.6043 +	esac
  1.6044 +
  1.6045 +	# Install the libtool object if requested.
  1.6046 +	if test -n "$destfile"; then
  1.6047 +	  $show "$install_prog $file $destfile"
  1.6048 +	  $run eval "$install_prog $file $destfile" || exit $?
  1.6049 +	fi
  1.6050 +
  1.6051 +	# Install the old object if enabled.
  1.6052 +	if test "$build_old_libs" = yes; then
  1.6053 +	  # Deduce the name of the old-style object file.
  1.6054 +	  staticobj=`$echo "X$file" | $Xsed -e "$lo2o"`
  1.6055 +
  1.6056 +	  $show "$install_prog $staticobj $staticdest"
  1.6057 +	  $run eval "$install_prog \$staticobj \$staticdest" || exit $?
  1.6058 +	fi
  1.6059 +	exit $EXIT_SUCCESS
  1.6060 +	;;
  1.6061 +
  1.6062 +      *)
  1.6063 +	# Figure out destination file name, if it wasn't already specified.
  1.6064 +	if test -n "$destname"; then
  1.6065 +	  destfile="$destdir/$destname"
  1.6066 +	else
  1.6067 +	  destfile=`$echo "X$file" | $Xsed -e 's%^.*/%%'`
  1.6068 +	  destfile="$destdir/$destfile"
  1.6069 +	fi
  1.6070 +
  1.6071 +	# If the file is missing, and there is a .exe on the end, strip it
  1.6072 +	# because it is most likely a libtool script we actually want to
  1.6073 +	# install
  1.6074 +	stripped_ext=""
  1.6075 +	case $file in
  1.6076 +	  *.exe)
  1.6077 +	    if test ! -f "$file"; then
  1.6078 +	      file=`$echo $file|${SED} 's,.exe$,,'`
  1.6079 +	      stripped_ext=".exe"
  1.6080 +	    fi
  1.6081 +	    ;;
  1.6082 +	esac
  1.6083 +
  1.6084 +	# Do a test to see if this is really a libtool program.
  1.6085 +	case $host in
  1.6086 +	*cygwin*|*mingw*)
  1.6087 +	    wrapper=`$echo $file | ${SED} -e 's,.exe$,,'`
  1.6088 +	    ;;
  1.6089 +	*)
  1.6090 +	    wrapper=$file
  1.6091 +	    ;;
  1.6092 +	esac
  1.6093 +	if (${SED} -e '4q' $wrapper | grep "^# Generated by .*$PACKAGE")>/dev/null 2>&1; then
  1.6094 +	  notinst_deplibs=
  1.6095 +	  relink_command=
  1.6096 +
  1.6097 +	  # Note that it is not necessary on cygwin/mingw to append a dot to
  1.6098 +	  # foo even if both foo and FILE.exe exist: automatic-append-.exe
  1.6099 +	  # behavior happens only for exec(3), not for open(2)!  Also, sourcing
  1.6100 +	  # `FILE.' does not work on cygwin managed mounts.
  1.6101 +	  #
  1.6102 +	  # If there is no directory component, then add one.
  1.6103 +	  case $wrapper in
  1.6104 +	  */* | *\\*) . ${wrapper} ;;
  1.6105 +	  *) . ./${wrapper} ;;
  1.6106 +	  esac
  1.6107 +
  1.6108 +	  # Check the variables that should have been set.
  1.6109 +	  if test -z "$notinst_deplibs"; then
  1.6110 +	    $echo "$modename: invalid libtool wrapper script \`$wrapper'" 1>&2
  1.6111 +	    exit $EXIT_FAILURE
  1.6112 +	  fi
  1.6113 +
  1.6114 +	  finalize=yes
  1.6115 +	  for lib in $notinst_deplibs; do
  1.6116 +	    # Check to see that each library is installed.
  1.6117 +	    libdir=
  1.6118 +	    if test -f "$lib"; then
  1.6119 +	      # If there is no directory component, then add one.
  1.6120 +	      case $lib in
  1.6121 +	      */* | *\\*) . $lib ;;
  1.6122 +	      *) . ./$lib ;;
  1.6123 +	      esac
  1.6124 +	    fi
  1.6125 +	    libfile="$libdir/"`$echo "X$lib" | $Xsed -e 's%^.*/%%g'` ### testsuite: skip nested quoting test
  1.6126 +	    if test -n "$libdir" && test ! -f "$libfile"; then
  1.6127 +	      $echo "$modename: warning: \`$lib' has not been installed in \`$libdir'" 1>&2
  1.6128 +	      finalize=no
  1.6129 +	    fi
  1.6130 +	  done
  1.6131 +
  1.6132 +	  relink_command=
  1.6133 +	  # Note that it is not necessary on cygwin/mingw to append a dot to
  1.6134 +	  # foo even if both foo and FILE.exe exist: automatic-append-.exe
  1.6135 +	  # behavior happens only for exec(3), not for open(2)!  Also, sourcing
  1.6136 +	  # `FILE.' does not work on cygwin managed mounts.
  1.6137 +	  #
  1.6138 +	  # If there is no directory component, then add one.
  1.6139 +	  case $wrapper in
  1.6140 +	  */* | *\\*) . ${wrapper} ;;
  1.6141 +	  *) . ./${wrapper} ;;
  1.6142 +	  esac
  1.6143 +
  1.6144 +	  outputname=
  1.6145 +	  if test "$fast_install" = no && test -n "$relink_command"; then
  1.6146 +	    if test "$finalize" = yes && test -z "$run"; then
  1.6147 +	      tmpdir=`func_mktempdir`
  1.6148 +	      file=`$echo "X$file$stripped_ext" | $Xsed -e 's%^.*/%%'`
  1.6149 +	      outputname="$tmpdir/$file"
  1.6150 +	      # Replace the output file specification.
  1.6151 +	      relink_command=`$echo "X$relink_command" | $Xsed -e 's%@OUTPUT@%'"$outputname"'%g'`
  1.6152 +
  1.6153 +	      $show "$relink_command"
  1.6154 +	      if $run eval "$relink_command"; then :
  1.6155 +	      else
  1.6156 +		$echo "$modename: error: relink \`$file' with the above command before installing it" 1>&2
  1.6157 +		${rm}r "$tmpdir"
  1.6158 +		continue
  1.6159 +	      fi
  1.6160 +	      file="$outputname"
  1.6161 +	    else
  1.6162 +	      $echo "$modename: warning: cannot relink \`$file'" 1>&2
  1.6163 +	    fi
  1.6164 +	  else
  1.6165 +	    # Install the binary that we compiled earlier.
  1.6166 +	    file=`$echo "X$file$stripped_ext" | $Xsed -e "s%\([^/]*\)$%$objdir/\1%"`
  1.6167 +	  fi
  1.6168 +	fi
  1.6169 +
  1.6170 +	# remove .exe since cygwin /usr/bin/install will append another
  1.6171 +	# one anyway 
  1.6172 +	case $install_prog,$host in
  1.6173 +	*/usr/bin/install*,*cygwin*)
  1.6174 +	  case $file:$destfile in
  1.6175 +	  *.exe:*.exe)
  1.6176 +	    # this is ok
  1.6177 +	    ;;
  1.6178 +	  *.exe:*)
  1.6179 +	    destfile=$destfile.exe
  1.6180 +	    ;;
  1.6181 +	  *:*.exe)
  1.6182 +	    destfile=`$echo $destfile | ${SED} -e 's,.exe$,,'`
  1.6183 +	    ;;
  1.6184 +	  esac
  1.6185 +	  ;;
  1.6186 +	esac
  1.6187 +	$show "$install_prog$stripme $file $destfile"
  1.6188 +	$run eval "$install_prog\$stripme \$file \$destfile" || exit $?
  1.6189 +	test -n "$outputname" && ${rm}r "$tmpdir"
  1.6190 +	;;
  1.6191 +      esac
  1.6192 +    done
  1.6193 +
  1.6194 +    for file in $staticlibs; do
  1.6195 +      name=`$echo "X$file" | $Xsed -e 's%^.*/%%'`
  1.6196 +
  1.6197 +      # Set up the ranlib parameters.
  1.6198 +      oldlib="$destdir/$name"
  1.6199 +
  1.6200 +      $show "$install_prog $file $oldlib"
  1.6201 +      $run eval "$install_prog \$file \$oldlib" || exit $?
  1.6202 +
  1.6203 +      if test -n "$stripme" && test -n "$old_striplib"; then
  1.6204 +	$show "$old_striplib $oldlib"
  1.6205 +	$run eval "$old_striplib $oldlib" || exit $?
  1.6206 +      fi
  1.6207 +
  1.6208 +      # Do each command in the postinstall commands.
  1.6209 +      cmds=$old_postinstall_cmds
  1.6210 +      save_ifs="$IFS"; IFS='~'
  1.6211 +      for cmd in $cmds; do
  1.6212 +	IFS="$save_ifs"
  1.6213 +	eval cmd=\"$cmd\"
  1.6214 +	$show "$cmd"
  1.6215 +	$run eval "$cmd" || exit $?
  1.6216 +      done
  1.6217 +      IFS="$save_ifs"
  1.6218 +    done
  1.6219 +
  1.6220 +    if test -n "$future_libdirs"; then
  1.6221 +      $echo "$modename: warning: remember to run \`$progname --finish$future_libdirs'" 1>&2
  1.6222 +    fi
  1.6223 +
  1.6224 +    if test -n "$current_libdirs"; then
  1.6225 +      # Maybe just do a dry run.
  1.6226 +      test -n "$run" && current_libdirs=" -n$current_libdirs"
  1.6227 +      exec_cmd='$SHELL $progpath $preserve_args --finish$current_libdirs'
  1.6228 +    else
  1.6229 +      exit $EXIT_SUCCESS
  1.6230 +    fi
  1.6231 +    ;;
  1.6232 +
  1.6233 +  # libtool finish mode
  1.6234 +  finish)
  1.6235 +    modename="$modename: finish"
  1.6236 +    libdirs="$nonopt"
  1.6237 +    admincmds=
  1.6238 +
  1.6239 +    if test -n "$finish_cmds$finish_eval" && test -n "$libdirs"; then
  1.6240 +      for dir
  1.6241 +      do
  1.6242 +	libdirs="$libdirs $dir"
  1.6243 +      done
  1.6244 +
  1.6245 +      for libdir in $libdirs; do
  1.6246 +	if test -n "$finish_cmds"; then
  1.6247 +	  # Do each command in the finish commands.
  1.6248 +	  cmds=$finish_cmds
  1.6249 +	  save_ifs="$IFS"; IFS='~'
  1.6250 +	  for cmd in $cmds; do
  1.6251 +	    IFS="$save_ifs"
  1.6252 +	    eval cmd=\"$cmd\"
  1.6253 +	    $show "$cmd"
  1.6254 +	    $run eval "$cmd" || admincmds="$admincmds
  1.6255 +       $cmd"
  1.6256 +	  done
  1.6257 +	  IFS="$save_ifs"
  1.6258 +	fi
  1.6259 +	if test -n "$finish_eval"; then
  1.6260 +	  # Do the single finish_eval.
  1.6261 +	  eval cmds=\"$finish_eval\"
  1.6262 +	  $run eval "$cmds" || admincmds="$admincmds
  1.6263 +       $cmds"
  1.6264 +	fi
  1.6265 +      done
  1.6266 +    fi
  1.6267 +
  1.6268 +    # Exit here if they wanted silent mode.
  1.6269 +    test "$show" = : && exit $EXIT_SUCCESS
  1.6270 +
  1.6271 +    $echo "X----------------------------------------------------------------------" | $Xsed
  1.6272 +    $echo "Libraries have been installed in:"
  1.6273 +    for libdir in $libdirs; do
  1.6274 +      $echo "   $libdir"
  1.6275 +    done
  1.6276 +    $echo
  1.6277 +    $echo "If you ever happen to want to link against installed libraries"
  1.6278 +    $echo "in a given directory, LIBDIR, you must either use libtool, and"
  1.6279 +    $echo "specify the full pathname of the library, or use the \`-LLIBDIR'"
  1.6280 +    $echo "flag during linking and do at least one of the following:"
  1.6281 +    if test -n "$shlibpath_var"; then
  1.6282 +      $echo "   - add LIBDIR to the \`$shlibpath_var' environment variable"
  1.6283 +      $echo "     during execution"
  1.6284 +    fi
  1.6285 +    if test -n "$runpath_var"; then
  1.6286 +      $echo "   - add LIBDIR to the \`$runpath_var' environment variable"
  1.6287 +      $echo "     during linking"
  1.6288 +    fi
  1.6289 +    if test -n "$hardcode_libdir_flag_spec"; then
  1.6290 +      libdir=LIBDIR
  1.6291 +      eval flag=\"$hardcode_libdir_flag_spec\"
  1.6292 +
  1.6293 +      $echo "   - use the \`$flag' linker flag"
  1.6294 +    fi
  1.6295 +    if test -n "$admincmds"; then
  1.6296 +      $echo "   - have your system administrator run these commands:$admincmds"
  1.6297 +    fi
  1.6298 +    if test -f /etc/ld.so.conf; then
  1.6299 +      $echo "   - have your system administrator add LIBDIR to \`/etc/ld.so.conf'"
  1.6300 +    fi
  1.6301 +    $echo
  1.6302 +    $echo "See any operating system documentation about shared libraries for"
  1.6303 +    $echo "more information, such as the ld(1) and ld.so(8) manual pages."
  1.6304 +    $echo "X----------------------------------------------------------------------" | $Xsed
  1.6305 +    exit $EXIT_SUCCESS
  1.6306 +    ;;
  1.6307 +
  1.6308 +  # libtool execute mode
  1.6309 +  execute)
  1.6310 +    modename="$modename: execute"
  1.6311 +
  1.6312 +    # The first argument is the command name.
  1.6313 +    cmd="$nonopt"
  1.6314 +    if test -z "$cmd"; then
  1.6315 +      $echo "$modename: you must specify a COMMAND" 1>&2
  1.6316 +      $echo "$help"
  1.6317 +      exit $EXIT_FAILURE
  1.6318 +    fi
  1.6319 +
  1.6320 +    # Handle -dlopen flags immediately.
  1.6321 +    for file in $execute_dlfiles; do
  1.6322 +      if test ! -f "$file"; then
  1.6323 +	$echo "$modename: \`$file' is not a file" 1>&2
  1.6324 +	$echo "$help" 1>&2
  1.6325 +	exit $EXIT_FAILURE
  1.6326 +      fi
  1.6327 +
  1.6328 +      dir=
  1.6329 +      case $file in
  1.6330 +      *.la)
  1.6331 +	# Check to see that this really is a libtool archive.
  1.6332 +	if (${SED} -e '2q' $file | grep "^# Generated by .*$PACKAGE") >/dev/null 2>&1; then :
  1.6333 +	else
  1.6334 +	  $echo "$modename: \`$lib' is not a valid libtool archive" 1>&2
  1.6335 +	  $echo "$help" 1>&2
  1.6336 +	  exit $EXIT_FAILURE
  1.6337 +	fi
  1.6338 +
  1.6339 +	# Read the libtool library.
  1.6340 +	dlname=
  1.6341 +	library_names=
  1.6342 +
  1.6343 +	# If there is no directory component, then add one.
  1.6344 +	case $file in
  1.6345 +	*/* | *\\*) . $file ;;
  1.6346 +	*) . ./$file ;;
  1.6347 +	esac
  1.6348 +
  1.6349 +	# Skip this library if it cannot be dlopened.
  1.6350 +	if test -z "$dlname"; then
  1.6351 +	  # Warn if it was a shared library.
  1.6352 +	  test -n "$library_names" && $echo "$modename: warning: \`$file' was not linked with \`-export-dynamic'"
  1.6353 +	  continue
  1.6354 +	fi
  1.6355 +
  1.6356 +	dir=`$echo "X$file" | $Xsed -e 's%/[^/]*$%%'`
  1.6357 +	test "X$dir" = "X$file" && dir=.
  1.6358 +
  1.6359 +	if test -f "$dir/$objdir/$dlname"; then
  1.6360 +	  dir="$dir/$objdir"
  1.6361 +	else
  1.6362 +	  $echo "$modename: cannot find \`$dlname' in \`$dir' or \`$dir/$objdir'" 1>&2
  1.6363 +	  exit $EXIT_FAILURE
  1.6364 +	fi
  1.6365 +	;;
  1.6366 +
  1.6367 +      *.lo)
  1.6368 +	# Just add the directory containing the .lo file.
  1.6369 +	dir=`$echo "X$file" | $Xsed -e 's%/[^/]*$%%'`
  1.6370 +	test "X$dir" = "X$file" && dir=.
  1.6371 +	;;
  1.6372 +
  1.6373 +      *)
  1.6374 +	$echo "$modename: warning \`-dlopen' is ignored for non-libtool libraries and objects" 1>&2
  1.6375 +	continue
  1.6376 +	;;
  1.6377 +      esac
  1.6378 +
  1.6379 +      # Get the absolute pathname.
  1.6380 +      absdir=`cd "$dir" && pwd`
  1.6381 +      test -n "$absdir" && dir="$absdir"
  1.6382 +
  1.6383 +      # Now add the directory to shlibpath_var.
  1.6384 +      if eval "test -z \"\$$shlibpath_var\""; then
  1.6385 +	eval "$shlibpath_var=\"\$dir\""
  1.6386 +      else
  1.6387 +	eval "$shlibpath_var=\"\$dir:\$$shlibpath_var\""
  1.6388 +      fi
  1.6389 +    done
  1.6390 +
  1.6391 +    # This variable tells wrapper scripts just to set shlibpath_var
  1.6392 +    # rather than running their programs.
  1.6393 +    libtool_execute_magic="$magic"
  1.6394 +
  1.6395 +    # Check if any of the arguments is a wrapper script.
  1.6396 +    args=
  1.6397 +    for file
  1.6398 +    do
  1.6399 +      case $file in
  1.6400 +      -*) ;;
  1.6401 +      *)
  1.6402 +	# Do a test to see if this is really a libtool program.
  1.6403 +	if (${SED} -e '4q' $file | grep "^# Generated by .*$PACKAGE") >/dev/null 2>&1; then
  1.6404 +	  # If there is no directory component, then add one.
  1.6405 +	  case $file in
  1.6406 +	  */* | *\\*) . $file ;;
  1.6407 +	  *) . ./$file ;;
  1.6408 +	  esac
  1.6409 +
  1.6410 +	  # Transform arg to wrapped name.
  1.6411 +	  file="$progdir/$program"
  1.6412 +	fi
  1.6413 +	;;
  1.6414 +      esac
  1.6415 +      # Quote arguments (to preserve shell metacharacters).
  1.6416 +      file=`$echo "X$file" | $Xsed -e "$sed_quote_subst"`
  1.6417 +      args="$args \"$file\""
  1.6418 +    done
  1.6419 +
  1.6420 +    if test -z "$run"; then
  1.6421 +      if test -n "$shlibpath_var"; then
  1.6422 +	# Export the shlibpath_var.
  1.6423 +	eval "export $shlibpath_var"
  1.6424 +      fi
  1.6425 +
  1.6426 +      # Restore saved environment variables
  1.6427 +      if test "${save_LC_ALL+set}" = set; then
  1.6428 +	LC_ALL="$save_LC_ALL"; export LC_ALL
  1.6429 +      fi
  1.6430 +      if test "${save_LANG+set}" = set; then
  1.6431 +	LANG="$save_LANG"; export LANG
  1.6432 +      fi
  1.6433 +
  1.6434 +      # Now prepare to actually exec the command.
  1.6435 +      exec_cmd="\$cmd$args"
  1.6436 +    else
  1.6437 +      # Display what would be done.
  1.6438 +      if test -n "$shlibpath_var"; then
  1.6439 +	eval "\$echo \"\$shlibpath_var=\$$shlibpath_var\""
  1.6440 +	$echo "export $shlibpath_var"
  1.6441 +      fi
  1.6442 +      $echo "$cmd$args"
  1.6443 +      exit $EXIT_SUCCESS
  1.6444 +    fi
  1.6445 +    ;;
  1.6446 +
  1.6447 +  # libtool clean and uninstall mode
  1.6448 +  clean | uninstall)
  1.6449 +    modename="$modename: $mode"
  1.6450 +    rm="$nonopt"
  1.6451 +    files=
  1.6452 +    rmforce=
  1.6453 +    exit_status=0
  1.6454 +
  1.6455 +    # This variable tells wrapper scripts just to set variables rather
  1.6456 +    # than running their programs.
  1.6457 +    libtool_install_magic="$magic"
  1.6458 +
  1.6459 +    for arg
  1.6460 +    do
  1.6461 +      case $arg in
  1.6462 +      -f) rm="$rm $arg"; rmforce=yes ;;
  1.6463 +      -*) rm="$rm $arg" ;;
  1.6464 +      *) files="$files $arg" ;;
  1.6465 +      esac
  1.6466 +    done
  1.6467 +
  1.6468 +    if test -z "$rm"; then
  1.6469 +      $echo "$modename: you must specify an RM program" 1>&2
  1.6470 +      $echo "$help" 1>&2
  1.6471 +      exit $EXIT_FAILURE
  1.6472 +    fi
  1.6473 +
  1.6474 +    rmdirs=
  1.6475 +
  1.6476 +    origobjdir="$objdir"
  1.6477 +    for file in $files; do
  1.6478 +      dir=`$echo "X$file" | $Xsed -e 's%/[^/]*$%%'`
  1.6479 +      if test "X$dir" = "X$file"; then
  1.6480 +	dir=.
  1.6481 +	objdir="$origobjdir"
  1.6482 +      else
  1.6483 +	objdir="$dir/$origobjdir"
  1.6484 +      fi
  1.6485 +      name=`$echo "X$file" | $Xsed -e 's%^.*/%%'`
  1.6486 +      test "$mode" = uninstall && objdir="$dir"
  1.6487 +
  1.6488 +      # Remember objdir for removal later, being careful to avoid duplicates
  1.6489 +      if test "$mode" = clean; then
  1.6490 +	case " $rmdirs " in
  1.6491 +	  *" $objdir "*) ;;
  1.6492 +	  *) rmdirs="$rmdirs $objdir" ;;
  1.6493 +	esac
  1.6494 +      fi
  1.6495 +
  1.6496 +      # Don't error if the file doesn't exist and rm -f was used.
  1.6497 +      if (test -L "$file") >/dev/null 2>&1 \
  1.6498 +	|| (test -h "$file") >/dev/null 2>&1 \
  1.6499 +	|| test -f "$file"; then
  1.6500 +	:
  1.6501 +      elif test -d "$file"; then
  1.6502 +	exit_status=1
  1.6503 +	continue
  1.6504 +      elif test "$rmforce" = yes; then
  1.6505 +	continue
  1.6506 +      fi
  1.6507 +
  1.6508 +      rmfiles="$file"
  1.6509 +
  1.6510 +      case $name in
  1.6511 +      *.la)
  1.6512 +	# Possibly a libtool archive, so verify it.
  1.6513 +	if (${SED} -e '2q' $file | grep "^# Generated by .*$PACKAGE") >/dev/null 2>&1; then
  1.6514 +	  . $dir/$name
  1.6515 +
  1.6516 +	  # Delete the libtool libraries and symlinks.
  1.6517 +	  for n in $library_names; do
  1.6518 +	    rmfiles="$rmfiles $objdir/$n"
  1.6519 +	  done
  1.6520 +	  test -n "$old_library" && rmfiles="$rmfiles $objdir/$old_library"
  1.6521 +
  1.6522 +	  case "$mode" in
  1.6523 +	  clean)
  1.6524 +	    case "  $library_names " in
  1.6525 +	    # "  " in the beginning catches empty $dlname
  1.6526 +	    *" $dlname "*) ;;
  1.6527 +	    *) rmfiles="$rmfiles $objdir/$dlname" ;;
  1.6528 +	    esac
  1.6529 +	     test -n "$libdir" && rmfiles="$rmfiles $objdir/$name $objdir/${name}i"
  1.6530 +	    ;;
  1.6531 +	  uninstall)
  1.6532 +	    if test -n "$library_names"; then
  1.6533 +	      # Do each command in the postuninstall commands.
  1.6534 +	      cmds=$postuninstall_cmds
  1.6535 +	      save_ifs="$IFS"; IFS='~'
  1.6536 +	      for cmd in $cmds; do
  1.6537 +		IFS="$save_ifs"
  1.6538 +		eval cmd=\"$cmd\"
  1.6539 +		$show "$cmd"
  1.6540 +		$run eval "$cmd"
  1.6541 +		if test "$?" -ne 0 && test "$rmforce" != yes; then
  1.6542 +		  exit_status=1
  1.6543 +		fi
  1.6544 +	      done
  1.6545 +	      IFS="$save_ifs"
  1.6546 +	    fi
  1.6547 +
  1.6548 +	    if test -n "$old_library"; then
  1.6549 +	      # Do each command in the old_postuninstall commands.
  1.6550 +	      cmds=$old_postuninstall_cmds
  1.6551 +	      save_ifs="$IFS"; IFS='~'
  1.6552 +	      for cmd in $cmds; do
  1.6553 +		IFS="$save_ifs"
  1.6554 +		eval cmd=\"$cmd\"
  1.6555 +		$show "$cmd"
  1.6556 +		$run eval "$cmd"
  1.6557 +		if test "$?" -ne 0 && test "$rmforce" != yes; then
  1.6558 +		  exit_status=1
  1.6559 +		fi
  1.6560 +	      done
  1.6561 +	      IFS="$save_ifs"
  1.6562 +	    fi
  1.6563 +	    # FIXME: should reinstall the best remaining shared library.
  1.6564 +	    ;;
  1.6565 +	  esac
  1.6566 +	fi
  1.6567 +	;;
  1.6568 +
  1.6569 +      *.lo)
  1.6570 +	# Possibly a libtool object, so verify it.
  1.6571 +	if (${SED} -e '2q' $file | grep "^# Generated by .*$PACKAGE") >/dev/null 2>&1; then
  1.6572 +
  1.6573 +	  # Read the .lo file
  1.6574 +	  . $dir/$name
  1.6575 +
  1.6576 +	  # Add PIC object to the list of files to remove.
  1.6577 +	  if test -n "$pic_object" \
  1.6578 +	     && test "$pic_object" != none; then
  1.6579 +	    rmfiles="$rmfiles $dir/$pic_object"
  1.6580 +	  fi
  1.6581 +
  1.6582 +	  # Add non-PIC object to the list of files to remove.
  1.6583 +	  if test -n "$non_pic_object" \
  1.6584 +	     && test "$non_pic_object" != none; then
  1.6585 +	    rmfiles="$rmfiles $dir/$non_pic_object"
  1.6586 +	  fi
  1.6587 +	fi
  1.6588 +	;;
  1.6589 +
  1.6590 +      *)
  1.6591 +	if test "$mode" = clean ; then
  1.6592 +	  noexename=$name
  1.6593 +	  case $file in
  1.6594 +	  *.exe)
  1.6595 +	    file=`$echo $file|${SED} 's,.exe$,,'`
  1.6596 +	    noexename=`$echo $name|${SED} 's,.exe$,,'`
  1.6597 +	    # $file with .exe has already been added to rmfiles,
  1.6598 +	    # add $file without .exe
  1.6599 +	    rmfiles="$rmfiles $file"
  1.6600 +	    ;;
  1.6601 +	  esac
  1.6602 +	  # Do a test to see if this is a libtool program.
  1.6603 +	  if (${SED} -e '4q' $file | grep "^# Generated by .*$PACKAGE") >/dev/null 2>&1; then
  1.6604 +	    relink_command=
  1.6605 +	    . $dir/$noexename
  1.6606 +
  1.6607 +	    # note $name still contains .exe if it was in $file originally
  1.6608 +	    # as does the version of $file that was added into $rmfiles
  1.6609 +	    rmfiles="$rmfiles $objdir/$name $objdir/${name}S.${objext}"
  1.6610 +	    if test "$fast_install" = yes && test -n "$relink_command"; then
  1.6611 +	      rmfiles="$rmfiles $objdir/lt-$name"
  1.6612 +	    fi
  1.6613 +	    if test "X$noexename" != "X$name" ; then
  1.6614 +	      rmfiles="$rmfiles $objdir/lt-${noexename}.c"
  1.6615 +	    fi
  1.6616 +	  fi
  1.6617 +	fi
  1.6618 +	;;
  1.6619 +      esac
  1.6620 +      $show "$rm $rmfiles"
  1.6621 +      $run $rm $rmfiles || exit_status=1
  1.6622 +    done
  1.6623 +    objdir="$origobjdir"
  1.6624 +
  1.6625 +    # Try to remove the ${objdir}s in the directories where we deleted files
  1.6626 +    for dir in $rmdirs; do
  1.6627 +      if test -d "$dir"; then
  1.6628 +	$show "rmdir $dir"
  1.6629 +	$run rmdir $dir >/dev/null 2>&1
  1.6630 +      fi
  1.6631 +    done
  1.6632 +
  1.6633 +    exit $exit_status
  1.6634 +    ;;
  1.6635 +
  1.6636 +  "")
  1.6637 +    $echo "$modename: you must specify a MODE" 1>&2
  1.6638 +    $echo "$generic_help" 1>&2
  1.6639 +    exit $EXIT_FAILURE
  1.6640 +    ;;
  1.6641 +  esac
  1.6642 +
  1.6643 +  if test -z "$exec_cmd"; then
  1.6644 +    $echo "$modename: invalid operation mode \`$mode'" 1>&2
  1.6645 +    $echo "$generic_help" 1>&2
  1.6646 +    exit $EXIT_FAILURE
  1.6647 +  fi
  1.6648 +fi # test -z "$show_help"
  1.6649 +
  1.6650 +if test -n "$exec_cmd"; then
  1.6651 +  eval exec $exec_cmd
  1.6652 +  exit $EXIT_FAILURE
  1.6653 +fi
  1.6654 +
  1.6655 +# We need to display help for each of the modes.
  1.6656 +case $mode in
  1.6657 +"") $echo \
  1.6658 +"Usage: $modename [OPTION]... [MODE-ARG]...
  1.6659 +
  1.6660 +Provide generalized library-building support services.
  1.6661 +
  1.6662 +    --config          show all configuration variables
  1.6663 +    --debug           enable verbose shell tracing
  1.6664 +-n, --dry-run         display commands without modifying any files
  1.6665 +    --features        display basic configuration information and exit
  1.6666 +    --finish          same as \`--mode=finish'
  1.6667 +    --help            display this help message and exit
  1.6668 +    --mode=MODE       use operation mode MODE [default=inferred from MODE-ARGS]
  1.6669 +    --quiet           same as \`--silent'
  1.6670 +    --silent          don't print informational messages
  1.6671 +    --tag=TAG         use configuration variables from tag TAG
  1.6672 +    --version         print version information
  1.6673 +
  1.6674 +MODE must be one of the following:
  1.6675 +
  1.6676 +      clean           remove files from the build directory
  1.6677 +      compile         compile a source file into a libtool object
  1.6678 +      execute         automatically set library path, then run a program
  1.6679 +      finish          complete the installation of libtool libraries
  1.6680 +      install         install libraries or executables
  1.6681 +      link            create a library or an executable
  1.6682 +      uninstall       remove libraries from an installed directory
  1.6683 +
  1.6684 +MODE-ARGS vary depending on the MODE.  Try \`$modename --help --mode=MODE' for
  1.6685 +a more detailed description of MODE.
  1.6686 +
  1.6687 +Report bugs to <bug-libtool@gnu.org>."
  1.6688 +  exit $EXIT_SUCCESS
  1.6689 +  ;;
  1.6690 +
  1.6691 +clean)
  1.6692 +  $echo \
  1.6693 +"Usage: $modename [OPTION]... --mode=clean RM [RM-OPTION]... FILE...
  1.6694 +
  1.6695 +Remove files from the build directory.
  1.6696 +
  1.6697 +RM is the name of the program to use to delete files associated with each FILE
  1.6698 +(typically \`/bin/rm').  RM-OPTIONS are options (such as \`-f') to be passed
  1.6699 +to RM.
  1.6700 +
  1.6701 +If FILE is a libtool library, object or program, all the files associated
  1.6702 +with it are deleted. Otherwise, only FILE itself is deleted using RM."
  1.6703 +  ;;
  1.6704 +
  1.6705 +compile)
  1.6706 +  $echo \
  1.6707 +"Usage: $modename [OPTION]... --mode=compile COMPILE-COMMAND... SOURCEFILE
  1.6708 +
  1.6709 +Compile a source file into a libtool library object.
  1.6710 +
  1.6711 +This mode accepts the following additional options:
  1.6712 +
  1.6713 +  -o OUTPUT-FILE    set the output file name to OUTPUT-FILE
  1.6714 +  -prefer-pic       try to building PIC objects only
  1.6715 +  -prefer-non-pic   try to building non-PIC objects only
  1.6716 +  -static           always build a \`.o' file suitable for static linking
  1.6717 +
  1.6718 +COMPILE-COMMAND is a command to be used in creating a \`standard' object file
  1.6719 +from the given SOURCEFILE.
  1.6720 +
  1.6721 +The output file name is determined by removing the directory component from
  1.6722 +SOURCEFILE, then substituting the C source code suffix \`.c' with the
  1.6723 +library object suffix, \`.lo'."
  1.6724 +  ;;
  1.6725 +
  1.6726 +execute)
  1.6727 +  $echo \
  1.6728 +"Usage: $modename [OPTION]... --mode=execute COMMAND [ARGS]...
  1.6729 +
  1.6730 +Automatically set library path, then run a program.
  1.6731 +
  1.6732 +This mode accepts the following additional options:
  1.6733 +
  1.6734 +  -dlopen FILE      add the directory containing FILE to the library path
  1.6735 +
  1.6736 +This mode sets the library path environment variable according to \`-dlopen'
  1.6737 +flags.
  1.6738 +
  1.6739 +If any of the ARGS are libtool executable wrappers, then they are translated
  1.6740 +into their corresponding uninstalled binary, and any of their required library
  1.6741 +directories are added to the library path.
  1.6742 +
  1.6743 +Then, COMMAND is executed, with ARGS as arguments."
  1.6744 +  ;;
  1.6745 +
  1.6746 +finish)
  1.6747 +  $echo \
  1.6748 +"Usage: $modename [OPTION]... --mode=finish [LIBDIR]...
  1.6749 +
  1.6750 +Complete the installation of libtool libraries.
  1.6751 +
  1.6752 +Each LIBDIR is a directory that contains libtool libraries.
  1.6753 +
  1.6754 +The commands that this mode executes may require superuser privileges.  Use
  1.6755 +the \`--dry-run' option if you just want to see what would be executed."
  1.6756 +  ;;
  1.6757 +
  1.6758 +install)
  1.6759 +  $echo \
  1.6760 +"Usage: $modename [OPTION]... --mode=install INSTALL-COMMAND...
  1.6761 +
  1.6762 +Install executables or libraries.
  1.6763 +
  1.6764 +INSTALL-COMMAND is the installation command.  The first component should be
  1.6765 +either the \`install' or \`cp' program.
  1.6766 +
  1.6767 +The rest of the components are interpreted as arguments to that command (only
  1.6768 +BSD-compatible install options are recognized)."
  1.6769 +  ;;
  1.6770 +
  1.6771 +link)
  1.6772 +  $echo \
  1.6773 +"Usage: $modename [OPTION]... --mode=link LINK-COMMAND...
  1.6774 +
  1.6775 +Link object files or libraries together to form another library, or to
  1.6776 +create an executable program.
  1.6777 +
  1.6778 +LINK-COMMAND is a command using the C compiler that you would use to create
  1.6779 +a program from several object files.
  1.6780 +
  1.6781 +The following components of LINK-COMMAND are treated specially:
  1.6782 +
  1.6783 +  -all-static       do not do any dynamic linking at all
  1.6784 +  -avoid-version    do not add a version suffix if possible
  1.6785 +  -dlopen FILE      \`-dlpreopen' FILE if it cannot be dlopened at runtime
  1.6786 +  -dlpreopen FILE   link in FILE and add its symbols to lt_preloaded_symbols
  1.6787 +  -export-dynamic   allow symbols from OUTPUT-FILE to be resolved with dlsym(3)
  1.6788 +  -export-symbols SYMFILE
  1.6789 +		    try to export only the symbols listed in SYMFILE
  1.6790 +  -export-symbols-regex REGEX
  1.6791 +		    try to export only the symbols matching REGEX
  1.6792 +  -LLIBDIR          search LIBDIR for required installed libraries
  1.6793 +  -lNAME            OUTPUT-FILE requires the installed library libNAME
  1.6794 +  -module           build a library that can dlopened
  1.6795 +  -no-fast-install  disable the fast-install mode
  1.6796 +  -no-install       link a not-installable executable
  1.6797 +  -no-undefined     declare that a library does not refer to external symbols
  1.6798 +  -o OUTPUT-FILE    create OUTPUT-FILE from the specified objects
  1.6799 +  -objectlist FILE  Use a list of object files found in FILE to specify objects
  1.6800 +  -precious-files-regex REGEX
  1.6801 +                    don't remove output files matching REGEX
  1.6802 +  -release RELEASE  specify package release information
  1.6803 +  -rpath LIBDIR     the created library will eventually be installed in LIBDIR
  1.6804 +  -R[ ]LIBDIR       add LIBDIR to the runtime path of programs and libraries
  1.6805 +  -static           do not do any dynamic linking of libtool libraries
  1.6806 +  -version-info CURRENT[:REVISION[:AGE]]
  1.6807 +		    specify library version info [each variable defaults to 0]
  1.6808 +
  1.6809 +All other options (arguments beginning with \`-') are ignored.
  1.6810 +
  1.6811 +Every other argument is treated as a filename.  Files ending in \`.la' are
  1.6812 +treated as uninstalled libtool libraries, other files are standard or library
  1.6813 +object files.
  1.6814 +
  1.6815 +If the OUTPUT-FILE ends in \`.la', then a libtool library is created,
  1.6816 +only library objects (\`.lo' files) may be specified, and \`-rpath' is
  1.6817 +required, except when creating a convenience library.
  1.6818 +
  1.6819 +If OUTPUT-FILE ends in \`.a' or \`.lib', then a standard library is created
  1.6820 +using \`ar' and \`ranlib', or on Windows using \`lib'.
  1.6821 +
  1.6822 +If OUTPUT-FILE ends in \`.lo' or \`.${objext}', then a reloadable object file
  1.6823 +is created, otherwise an executable program is created."
  1.6824 +  ;;
  1.6825 +
  1.6826 +uninstall)
  1.6827 +  $echo \
  1.6828 +"Usage: $modename [OPTION]... --mode=uninstall RM [RM-OPTION]... FILE...
  1.6829 +
  1.6830 +Remove libraries from an installation directory.
  1.6831 +
  1.6832 +RM is the name of the program to use to delete files associated with each FILE
  1.6833 +(typically \`/bin/rm').  RM-OPTIONS are options (such as \`-f') to be passed
  1.6834 +to RM.
  1.6835 +
  1.6836 +If FILE is a libtool library, all the files associated with it are deleted.
  1.6837 +Otherwise, only FILE itself is deleted using RM."
  1.6838 +  ;;
  1.6839 +
  1.6840 +*)
  1.6841 +  $echo "$modename: invalid operation mode \`$mode'" 1>&2
  1.6842 +  $echo "$help" 1>&2
  1.6843 +  exit $EXIT_FAILURE
  1.6844 +  ;;
  1.6845 +esac
  1.6846 +
  1.6847 +$echo
  1.6848 +$echo "Try \`$modename --help' for more information about other modes."
  1.6849 +
  1.6850 +exit $?
  1.6851 +
  1.6852 +# The TAGs below are defined such that we never get into a situation
  1.6853 +# in which we disable both kinds of libraries.  Given conflicting
  1.6854 +# choices, we go for a static library, that is the most portable,
  1.6855 +# since we can't tell whether shared libraries were disabled because
  1.6856 +# the user asked for that or because the platform doesn't support
  1.6857 +# them.  This is particularly important on AIX, because we don't
  1.6858 +# support having both static and shared libraries enabled at the same
  1.6859 +# time on that platform, so we default to a shared-only configuration.
  1.6860 +# If a disable-shared tag is given, we'll fallback to a static-only
  1.6861 +# configuration.  But we'll never go from static-only to shared-only.
  1.6862 +
  1.6863 +# ### BEGIN LIBTOOL TAG CONFIG: disable-shared
  1.6864 +disable_libs=shared
  1.6865 +# ### END LIBTOOL TAG CONFIG: disable-shared
  1.6866 +
  1.6867 +# ### BEGIN LIBTOOL TAG CONFIG: disable-static
  1.6868 +disable_libs=static
  1.6869 +# ### END LIBTOOL TAG CONFIG: disable-static
  1.6870 +
  1.6871 +# Local Variables:
  1.6872 +# mode:shell-script
  1.6873 +# sh-indentation:2
  1.6874 +# End: