Blame ltmain.sh

Packit d36e9b
# ltmain.sh - Provide generalized library-building support services.
Packit d36e9b
# NOTE: Changing this file will not affect anything until you rerun configure.
Packit d36e9b
#
Packit d36e9b
# Copyright (C) 1996, 1997, 1998, 1999, 2000, 2001, 2003, 2004, 2005
Packit d36e9b
# Free Software Foundation, Inc.
Packit d36e9b
# Originally by Gordon Matzigkeit <gord@gnu.ai.mit.edu>, 1996
Packit d36e9b
#
Packit d36e9b
# This program is free software; you can redistribute it and/or modify
Packit d36e9b
# it under the terms of the GNU General Public License as published by
Packit d36e9b
# the Free Software Foundation; either version 2 of the License, or
Packit d36e9b
# (at your option) any later version.
Packit d36e9b
#
Packit d36e9b
# This program is distributed in the hope that it will be useful, but
Packit d36e9b
# WITHOUT ANY WARRANTY; without even the implied warranty of
Packit d36e9b
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
Packit d36e9b
# General Public License for more details.
Packit d36e9b
#
Packit d36e9b
# You should have received a copy of the GNU General Public License
Packit d36e9b
# along with this program; if not, write to the Free Software
Packit d36e9b
# Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
Packit d36e9b
#
Packit d36e9b
# As a special exception to the GNU General Public License, if you
Packit d36e9b
# distribute this file as part of a program that contains a
Packit d36e9b
# configuration script generated by Autoconf, you may include it under
Packit d36e9b
# the same distribution terms that you use for the rest of that program.
Packit d36e9b
Packit d36e9b
basename="s,^.*/,,g"
Packit d36e9b
Packit d36e9b
# Work around backward compatibility issue on IRIX 6.5. On IRIX 6.4+, sh
Packit d36e9b
# is ksh but when the shell is invoked as "sh" and the current value of
Packit d36e9b
# the _XPG environment variable is not equal to 1 (one), the special
Packit d36e9b
# positional parameter $0, within a function call, is the name of the
Packit d36e9b
# function.
Packit d36e9b
progpath="$0"
Packit d36e9b
Packit d36e9b
# The name of this program:
Packit d36e9b
progname=`echo "$progpath" | $SED $basename`
Packit d36e9b
modename="$progname"
Packit d36e9b
Packit d36e9b
# Global variables:
Packit d36e9b
EXIT_SUCCESS=0
Packit d36e9b
EXIT_FAILURE=1
Packit d36e9b
Packit d36e9b
PROGRAM=ltmain.sh
Packit d36e9b
PACKAGE=libtool
Packit d36e9b
VERSION=1.5.22
Packit d36e9b
TIMESTAMP=" (1.1220.2.365 2005/12/18 22:14:06)"
Packit d36e9b
Packit d36e9b
# Be Bourne compatible (taken from Autoconf:_AS_BOURNE_COMPATIBLE).
Packit d36e9b
if test -n "${ZSH_VERSION+set}" && (emulate sh) >/dev/null 2>&1; then
Packit d36e9b
  emulate sh
Packit d36e9b
  NULLCMD=:
Packit d36e9b
  # Zsh 3.x and 4.x performs word splitting on ${1+"$@"}, which
Packit d36e9b
  # is contrary to our usage.  Disable this feature.
Packit d36e9b
  alias -g '${1+"$@"}'='"$@"'
Packit d36e9b
  setopt NO_GLOB_SUBST
Packit d36e9b
else
Packit d36e9b
  case `(set -o) 2>/dev/null` in *posix*) set -o posix;; esac
Packit d36e9b
fi
Packit d36e9b
Packit d36e9b
# Check that we have a working $echo.
Packit d36e9b
if test "X$1" = X--no-reexec; then
Packit d36e9b
  # Discard the --no-reexec flag, and continue.
Packit d36e9b
  shift
Packit d36e9b
elif test "X$1" = X--fallback-echo; then
Packit d36e9b
  # Avoid inline document here, it may be left over
Packit d36e9b
  :
Packit d36e9b
elif test "X`($echo '\t') 2>/dev/null`" = 'X\t'; then
Packit d36e9b
  # Yippee, $echo works!
Packit d36e9b
  :
Packit d36e9b
else
Packit d36e9b
  # Restart under the correct shell, and then maybe $echo will work.
Packit d36e9b
  exec $SHELL "$progpath" --no-reexec ${1+"$@"}
Packit d36e9b
fi
Packit d36e9b
Packit d36e9b
if test "X$1" = X--fallback-echo; then
Packit d36e9b
  # used as fallback echo
Packit d36e9b
  shift
Packit d36e9b
  cat <
Packit d36e9b
$*
Packit d36e9b
EOF
Packit d36e9b
  exit $EXIT_SUCCESS
Packit d36e9b
fi
Packit d36e9b
Packit d36e9b
default_mode=
Packit d36e9b
help="Try \`$progname --help' for more information."
Packit d36e9b
magic="%%%MAGIC variable%%%"
Packit d36e9b
mkdir="mkdir"
Packit d36e9b
mv="mv -f"
Packit d36e9b
rm="rm -f"
Packit d36e9b
Packit d36e9b
# Sed substitution that helps us do robust quoting.  It backslashifies
Packit d36e9b
# metacharacters that are still active within double-quoted strings.
Packit d36e9b
Xsed="${SED}"' -e 1s/^X//'
Packit d36e9b
sed_quote_subst='s/\([\\`\\"$\\\\]\)/\\\1/g'
Packit d36e9b
# test EBCDIC or ASCII
Packit d36e9b
case `echo X|tr X '\101'` in
Packit d36e9b
 A) # ASCII based system
Packit d36e9b
    # \n is not interpreted correctly by Solaris 8 /usr/ucb/tr
Packit d36e9b
  SP2NL='tr \040 \012'
Packit d36e9b
  NL2SP='tr \015\012 \040\040'
Packit d36e9b
  ;;
Packit d36e9b
 *) # EBCDIC based system
Packit d36e9b
  SP2NL='tr \100 \n'
Packit d36e9b
  NL2SP='tr \r\n \100\100'
Packit d36e9b
  ;;
Packit d36e9b
esac
Packit d36e9b
Packit d36e9b
# NLS nuisances.
Packit d36e9b
# Only set LANG and LC_ALL to C if already set.
Packit d36e9b
# These must not be set unconditionally because not all systems understand
Packit d36e9b
# e.g. LANG=C (notably SCO).
Packit d36e9b
# We save the old values to restore during execute mode.
Packit d36e9b
for lt_var in LANG LC_ALL LC_CTYPE LC_COLLATE LC_MESSAGES
Packit d36e9b
do
Packit d36e9b
  eval "if test \"\${$lt_var+set}\" = set; then
Packit d36e9b
         save_$lt_var=\$$lt_var
Packit d36e9b
         $lt_var=C
Packit d36e9b
         export $lt_var
Packit d36e9b
       fi"
Packit d36e9b
done
Packit d36e9b
Packit d36e9b
# Make sure IFS has a sensible default
Packit d36e9b
lt_nl='
Packit d36e9b
'
Packit d36e9b
IFS=" 	$lt_nl"
Packit d36e9b
Packit d36e9b
if test "$build_libtool_libs" != yes && test "$build_old_libs" != yes; then
Packit d36e9b
  $echo "$modename: not configured to build any kind of library" 1>&2
Packit d36e9b
  $echo "Fatal configuration error.  See the $PACKAGE docs for more information." 1>&2
Packit d36e9b
  exit $EXIT_FAILURE
Packit d36e9b
fi
Packit d36e9b
Packit d36e9b
# Global variables.
Packit d36e9b
mode=$default_mode
Packit d36e9b
nonopt=
Packit d36e9b
prev=
Packit d36e9b
prevopt=
Packit d36e9b
run=
Packit d36e9b
show="$echo"
Packit d36e9b
show_help=
Packit d36e9b
execute_dlfiles=
Packit d36e9b
duplicate_deps=no
Packit d36e9b
preserve_args=
Packit d36e9b
lo2o="s/\\.lo\$/.${objext}/"
Packit d36e9b
o2lo="s/\\.${objext}\$/.lo/"
Packit d36e9b
extracted_archives=
Packit d36e9b
extracted_serial=0
Packit d36e9b
Packit d36e9b
#####################################
Packit d36e9b
# Shell function definitions:
Packit d36e9b
# This seems to be the best place for them
Packit d36e9b
Packit d36e9b
# func_mktempdir [string]
Packit d36e9b
# Make a temporary directory that won't clash with other running
Packit d36e9b
# libtool processes, and avoids race conditions if possible.  If
Packit d36e9b
# given, STRING is the basename for that directory.
Packit d36e9b
func_mktempdir ()
Packit d36e9b
{
Packit d36e9b
    my_template="${TMPDIR-/tmp}/${1-$progname}"
Packit d36e9b
Packit d36e9b
    if test "$run" = ":"; then
Packit d36e9b
      # Return a directory name, but don't create it in dry-run mode
Packit d36e9b
      my_tmpdir="${my_template}-$$"
Packit d36e9b
    else
Packit d36e9b
Packit d36e9b
      # If mktemp works, use that first and foremost
Packit d36e9b
      my_tmpdir=`mktemp -d "${my_template}-XXXXXXXX" 2>/dev/null`
Packit d36e9b
Packit d36e9b
      if test ! -d "$my_tmpdir"; then
Packit d36e9b
	# Failing that, at least try and use $RANDOM to avoid a race
Packit d36e9b
	my_tmpdir="${my_template}-${RANDOM-0}$$"
Packit d36e9b
Packit d36e9b
	save_mktempdir_umask=`umask`
Packit d36e9b
	umask 0077
Packit d36e9b
	$mkdir "$my_tmpdir"
Packit d36e9b
	umask $save_mktempdir_umask
Packit d36e9b
      fi
Packit d36e9b
Packit d36e9b
      # If we're not in dry-run mode, bomb out on failure
Packit d36e9b
      test -d "$my_tmpdir" || {
Packit d36e9b
        $echo "cannot create temporary directory \`$my_tmpdir'" 1>&2
Packit d36e9b
	exit $EXIT_FAILURE
Packit d36e9b
      }
Packit d36e9b
    fi
Packit d36e9b
Packit d36e9b
    $echo "X$my_tmpdir" | $Xsed
Packit d36e9b
}
Packit d36e9b
Packit d36e9b
Packit d36e9b
# func_win32_libid arg
Packit d36e9b
# return the library type of file 'arg'
Packit d36e9b
#
Packit d36e9b
# Need a lot of goo to handle *both* DLLs and import libs
Packit d36e9b
# Has to be a shell function in order to 'eat' the argument
Packit d36e9b
# that is supplied when $file_magic_command is called.
Packit d36e9b
func_win32_libid ()
Packit d36e9b
{
Packit d36e9b
  win32_libid_type="unknown"
Packit d36e9b
  win32_fileres=`file -L $1 2>/dev/null`
Packit d36e9b
  case $win32_fileres in
Packit d36e9b
  *ar\ archive\ import\ library*) # definitely import
Packit d36e9b
    win32_libid_type="x86 archive import"
Packit d36e9b
    ;;
Packit d36e9b
  *ar\ archive*) # could be an import, or static
Packit d36e9b
    if eval $OBJDUMP -f $1 | $SED -e '10q' 2>/dev/null | \
Packit d36e9b
      $EGREP -e 'file format pe-i386(.*architecture: i386)?' >/dev/null ; then
Packit d36e9b
      win32_nmres=`eval $NM -f posix -A $1 | \
Packit d36e9b
	$SED -n -e '1,100{/ I /{s,.*,import,;p;q;};}'`
Packit d36e9b
      case $win32_nmres in
Packit d36e9b
      import*)  win32_libid_type="x86 archive import";;
Packit d36e9b
      *)        win32_libid_type="x86 archive static";;
Packit d36e9b
      esac
Packit d36e9b
    fi
Packit d36e9b
    ;;
Packit d36e9b
  *DLL*)
Packit d36e9b
    win32_libid_type="x86 DLL"
Packit d36e9b
    ;;
Packit d36e9b
  *executable*) # but shell scripts are "executable" too...
Packit d36e9b
    case $win32_fileres in
Packit d36e9b
    *MS\ Windows\ PE\ Intel*)
Packit d36e9b
      win32_libid_type="x86 DLL"
Packit d36e9b
      ;;
Packit d36e9b
    esac
Packit d36e9b
    ;;
Packit d36e9b
  esac
Packit d36e9b
  $echo $win32_libid_type
Packit d36e9b
}
Packit d36e9b
Packit d36e9b
Packit d36e9b
# func_infer_tag arg
Packit d36e9b
# Infer tagged configuration to use if any are available and
Packit d36e9b
# if one wasn't chosen via the "--tag" command line option.
Packit d36e9b
# Only attempt this if the compiler in the base compile
Packit d36e9b
# command doesn't match the default compiler.
Packit d36e9b
# arg is usually of the form 'gcc ...'
Packit d36e9b
func_infer_tag ()
Packit d36e9b
{
Packit d36e9b
    if test -n "$available_tags" && test -z "$tagname"; then
Packit d36e9b
      CC_quoted=
Packit d36e9b
      for arg in $CC; do
Packit d36e9b
	case $arg in
Packit d36e9b
	  *[\[\~\#\^\&\*\(\)\{\}\|\;\<\>\?\'\ \	]*|*]*|"")
Packit d36e9b
	  arg="\"$arg\""
Packit d36e9b
	  ;;
Packit d36e9b
	esac
Packit d36e9b
	CC_quoted="$CC_quoted $arg"
Packit d36e9b
      done
Packit d36e9b
      case $@ in
Packit d36e9b
      # Blanks in the command may have been stripped by the calling shell,
Packit d36e9b
      # but not from the CC environment variable when configure was run.
Packit d36e9b
      " $CC "* | "$CC "* | " `$echo $CC` "* | "`$echo $CC` "* | " $CC_quoted"* | "$CC_quoted "* | " `$echo $CC_quoted` "* | "`$echo $CC_quoted` "*) ;;
Packit d36e9b
      # Blanks at the start of $base_compile will cause this to fail
Packit d36e9b
      # if we don't check for them as well.
Packit d36e9b
      *)
Packit d36e9b
	for z in $available_tags; do
Packit d36e9b
	  if grep "^# ### BEGIN LIBTOOL TAG CONFIG: $z$" < "$progpath" > /dev/null; then
Packit d36e9b
	    # Evaluate the configuration.
Packit d36e9b
	    eval "`${SED} -n -e '/^# ### BEGIN LIBTOOL TAG CONFIG: '$z'$/,/^# ### END LIBTOOL TAG CONFIG: '$z'$/p' < $progpath`"
Packit d36e9b
	    CC_quoted=
Packit d36e9b
	    for arg in $CC; do
Packit d36e9b
	    # Double-quote args containing other shell metacharacters.
Packit d36e9b
	    case $arg in
Packit d36e9b
	      *[\[\~\#\^\&\*\(\)\{\}\|\;\<\>\?\'\ \	]*|*]*|"")
Packit d36e9b
	      arg="\"$arg\""
Packit d36e9b
	      ;;
Packit d36e9b
	    esac
Packit d36e9b
	    CC_quoted="$CC_quoted $arg"
Packit d36e9b
	  done
Packit d36e9b
	    case "$@ " in
Packit d36e9b
	      " $CC "* | "$CC "* | " `$echo $CC` "* | "`$echo $CC` "* | " $CC_quoted"* | "$CC_quoted "* | " `$echo $CC_quoted` "* | "`$echo $CC_quoted` "*)
Packit d36e9b
	      # The compiler in the base compile command matches
Packit d36e9b
	      # the one in the tagged configuration.
Packit d36e9b
	      # Assume this is the tagged configuration we want.
Packit d36e9b
	      tagname=$z
Packit d36e9b
	      break
Packit d36e9b
	      ;;
Packit d36e9b
	    esac
Packit d36e9b
	  fi
Packit d36e9b
	done
Packit d36e9b
	# If $tagname still isn't set, then no tagged configuration
Packit d36e9b
	# was found and let the user know that the "--tag" command
Packit d36e9b
	# line option must be used.
Packit d36e9b
	if test -z "$tagname"; then
Packit d36e9b
	  $echo "$modename: unable to infer tagged configuration"
Packit d36e9b
	  $echo "$modename: specify a tag with \`--tag'" 1>&2
Packit d36e9b
	  exit $EXIT_FAILURE
Packit d36e9b
#        else
Packit d36e9b
#          $echo "$modename: using $tagname tagged configuration"
Packit d36e9b
	fi
Packit d36e9b
	;;
Packit d36e9b
      esac
Packit d36e9b
    fi
Packit d36e9b
}
Packit d36e9b
Packit d36e9b
Packit d36e9b
# func_extract_an_archive dir oldlib
Packit d36e9b
func_extract_an_archive ()
Packit d36e9b
{
Packit d36e9b
    f_ex_an_ar_dir="$1"; shift
Packit d36e9b
    f_ex_an_ar_oldlib="$1"
Packit d36e9b
Packit d36e9b
    $show "(cd $f_ex_an_ar_dir && $AR x $f_ex_an_ar_oldlib)"
Packit d36e9b
    $run eval "(cd \$f_ex_an_ar_dir && $AR x \$f_ex_an_ar_oldlib)" || exit $?
Packit d36e9b
    if ($AR t "$f_ex_an_ar_oldlib" | sort | sort -uc >/dev/null 2>&1;; then
Packit d36e9b
     :
Packit d36e9b
    else
Packit d36e9b
      $echo "$modename: ERROR: object name conflicts: $f_ex_an_ar_dir/$f_ex_an_ar_oldlib" 1>&2
Packit d36e9b
      exit $EXIT_FAILURE
Packit d36e9b
    fi
Packit d36e9b
}
Packit d36e9b
Packit d36e9b
# func_extract_archives gentop oldlib ...
Packit d36e9b
func_extract_archives ()
Packit d36e9b
{
Packit d36e9b
    my_gentop="$1"; shift
Packit d36e9b
    my_oldlibs=${1+"$@"}
Packit d36e9b
    my_oldobjs=""
Packit d36e9b
    my_xlib=""
Packit d36e9b
    my_xabs=""
Packit d36e9b
    my_xdir=""
Packit d36e9b
    my_status=""
Packit d36e9b
Packit d36e9b
    $show "${rm}r $my_gentop"
Packit d36e9b
    $run ${rm}r "$my_gentop"
Packit d36e9b
    $show "$mkdir $my_gentop"
Packit d36e9b
    $run $mkdir "$my_gentop"
Packit d36e9b
    my_status=$?
Packit d36e9b
    if test "$my_status" -ne 0 && test ! -d "$my_gentop"; then
Packit d36e9b
      exit $my_status
Packit d36e9b
    fi
Packit d36e9b
Packit d36e9b
    for my_xlib in $my_oldlibs; do
Packit d36e9b
      # Extract the objects.
Packit d36e9b
      case $my_xlib in
Packit d36e9b
	[\\/]* | [A-Za-z]:[\\/]*) my_xabs="$my_xlib" ;;
Packit d36e9b
	*) my_xabs=`pwd`"/$my_xlib" ;;
Packit d36e9b
      esac
Packit d36e9b
      my_xlib=`$echo "X$my_xlib" | $Xsed -e 's%^.*/%%'`
Packit d36e9b
      my_xlib_u=$my_xlib
Packit d36e9b
      while :; do
Packit d36e9b
        case " $extracted_archives " in
Packit d36e9b
       *" $my_xlib_u "*)
Packit d36e9b
         extracted_serial=`expr $extracted_serial + 1`
Packit d36e9b
         my_xlib_u=lt$extracted_serial-$my_xlib ;;
Packit d36e9b
       *) break ;;
Packit d36e9b
       esac
Packit d36e9b
      done
Packit d36e9b
      extracted_archives="$extracted_archives $my_xlib_u"
Packit d36e9b
      my_xdir="$my_gentop/$my_xlib_u"
Packit d36e9b
Packit d36e9b
      $show "${rm}r $my_xdir"
Packit d36e9b
      $run ${rm}r "$my_xdir"
Packit d36e9b
      $show "$mkdir $my_xdir"
Packit d36e9b
      $run $mkdir "$my_xdir"
Packit d36e9b
      exit_status=$?
Packit d36e9b
      if test "$exit_status" -ne 0 && test ! -d "$my_xdir"; then
Packit d36e9b
	exit $exit_status
Packit d36e9b
      fi
Packit d36e9b
      case $host in
Packit d36e9b
      *-darwin*)
Packit d36e9b
	$show "Extracting $my_xabs"
Packit d36e9b
	# Do not bother doing anything if just a dry run
Packit d36e9b
	if test -z "$run"; then
Packit d36e9b
	  darwin_orig_dir=`pwd`
Packit d36e9b
	  cd $my_xdir || exit $?
Packit d36e9b
	  darwin_archive=$my_xabs
Packit d36e9b
	  darwin_curdir=`pwd`
Packit d36e9b
	  darwin_base_archive=`$echo "X$darwin_archive" | $Xsed -e 's%^.*/%%'`
Packit d36e9b
	  darwin_arches=`lipo -info "$darwin_archive" 2>/dev/null | $EGREP Architectures 2>/dev/null`
Packit d36e9b
	  if test -n "$darwin_arches"; then 
Packit d36e9b
	    darwin_arches=`echo "$darwin_arches" | $SED -e 's/.*are://'`
Packit d36e9b
	    darwin_arch=
Packit d36e9b
	    $show "$darwin_base_archive has multiple architectures $darwin_arches"
Packit d36e9b
	    for darwin_arch in  $darwin_arches ; do
Packit d36e9b
	      mkdir -p "unfat-$$/${darwin_base_archive}-${darwin_arch}"
Packit d36e9b
	      lipo -thin $darwin_arch -output "unfat-$$/${darwin_base_archive}-${darwin_arch}/${darwin_base_archive}" "${darwin_archive}"
Packit d36e9b
	      cd "unfat-$$/${darwin_base_archive}-${darwin_arch}"
Packit d36e9b
	      func_extract_an_archive "`pwd`" "${darwin_base_archive}"
Packit d36e9b
	      cd "$darwin_curdir"
Packit d36e9b
	      $rm "unfat-$$/${darwin_base_archive}-${darwin_arch}/${darwin_base_archive}"
Packit d36e9b
	    done # $darwin_arches
Packit d36e9b
      ## Okay now we have a bunch of thin objects, gotta fatten them up :)
Packit d36e9b
	    darwin_filelist=`find unfat-$$ -type f -name \*.o -print -o -name \*.lo -print| xargs basename | sort -u | $NL2SP`
Packit d36e9b
	    darwin_file=
Packit d36e9b
	    darwin_files=
Packit d36e9b
	    for darwin_file in $darwin_filelist; do
Packit d36e9b
	      darwin_files=`find unfat-$$ -name $darwin_file -print | $NL2SP`
Packit d36e9b
	      lipo -create -output "$darwin_file" $darwin_files
Packit d36e9b
	    done # $darwin_filelist
Packit d36e9b
	    ${rm}r unfat-$$
Packit d36e9b
	    cd "$darwin_orig_dir"
Packit d36e9b
	  else
Packit d36e9b
	    cd "$darwin_orig_dir"
Packit d36e9b
 	    func_extract_an_archive "$my_xdir" "$my_xabs"
Packit d36e9b
	  fi # $darwin_arches
Packit d36e9b
	fi # $run
Packit d36e9b
	;;
Packit d36e9b
      *)
Packit d36e9b
        func_extract_an_archive "$my_xdir" "$my_xabs"
Packit d36e9b
        ;;
Packit d36e9b
      esac
Packit d36e9b
      my_oldobjs="$my_oldobjs "`find $my_xdir -name \*.$objext -print -o -name \*.lo -print | $NL2SP`
Packit d36e9b
    done
Packit d36e9b
    func_extract_archives_result="$my_oldobjs"
Packit d36e9b
}
Packit d36e9b
# End of Shell function definitions
Packit d36e9b
#####################################
Packit d36e9b
Packit d36e9b
# Darwin sucks
Packit d36e9b
eval std_shrext=\"$shrext_cmds\"
Packit d36e9b
Packit d36e9b
disable_libs=no
Packit d36e9b
Packit d36e9b
# Parse our command line options once, thoroughly.
Packit d36e9b
while test "$#" -gt 0
Packit d36e9b
do
Packit d36e9b
  arg="$1"
Packit d36e9b
  shift
Packit d36e9b
Packit d36e9b
  case $arg in
Packit d36e9b
  -*=*) optarg=`$echo "X$arg" | $Xsed -e 's/[-_a-zA-Z0-9]*=//'` ;;
Packit d36e9b
  *) optarg= ;;
Packit d36e9b
  esac
Packit d36e9b
Packit d36e9b
  # If the previous option needs an argument, assign it.
Packit d36e9b
  if test -n "$prev"; then
Packit d36e9b
    case $prev in
Packit d36e9b
    execute_dlfiles)
Packit d36e9b
      execute_dlfiles="$execute_dlfiles $arg"
Packit d36e9b
      ;;
Packit d36e9b
    tag)
Packit d36e9b
      tagname="$arg"
Packit d36e9b
      preserve_args="${preserve_args}=$arg"
Packit d36e9b
Packit d36e9b
      # Check whether tagname contains only valid characters
Packit d36e9b
      case $tagname in
Packit d36e9b
      *[!-_A-Za-z0-9,/]*)
Packit d36e9b
	$echo "$progname: invalid tag name: $tagname" 1>&2
Packit d36e9b
	exit $EXIT_FAILURE
Packit d36e9b
	;;
Packit d36e9b
      esac
Packit d36e9b
Packit d36e9b
      case $tagname in
Packit d36e9b
      CC)
Packit d36e9b
	# Don't test for the "default" C tag, as we know, it's there, but
Packit d36e9b
	# not specially marked.
Packit d36e9b
	;;
Packit d36e9b
      *)
Packit d36e9b
	if grep "^# ### BEGIN LIBTOOL TAG CONFIG: $tagname$" < "$progpath" > /dev/null; then
Packit d36e9b
	  taglist="$taglist $tagname"
Packit d36e9b
	  # Evaluate the configuration.
Packit d36e9b
	  eval "`${SED} -n -e '/^# ### BEGIN LIBTOOL TAG CONFIG: '$tagname'$/,/^# ### END LIBTOOL TAG CONFIG: '$tagname'$/p' < $progpath`"
Packit d36e9b
	else
Packit d36e9b
	  $echo "$progname: ignoring unknown tag $tagname" 1>&2
Packit d36e9b
	fi
Packit d36e9b
	;;
Packit d36e9b
      esac
Packit d36e9b
      ;;
Packit d36e9b
    *)
Packit d36e9b
      eval "$prev=\$arg"
Packit d36e9b
      ;;
Packit d36e9b
    esac
Packit d36e9b
Packit d36e9b
    prev=
Packit d36e9b
    prevopt=
Packit d36e9b
    continue
Packit d36e9b
  fi
Packit d36e9b
Packit d36e9b
  # Have we seen a non-optional argument yet?
Packit d36e9b
  case $arg in
Packit d36e9b
  --help)
Packit d36e9b
    show_help=yes
Packit d36e9b
    ;;
Packit d36e9b
Packit d36e9b
  --version)
Packit d36e9b
    $echo "$PROGRAM (GNU $PACKAGE) $VERSION$TIMESTAMP"
Packit d36e9b
    $echo
Packit d36e9b
    $echo "Copyright (C) 2005  Free Software Foundation, Inc."
Packit d36e9b
    $echo "This is free software; see the source for copying conditions.  There is NO"
Packit d36e9b
    $echo "warranty; not even for MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE."
Packit d36e9b
    exit $?
Packit d36e9b
    ;;
Packit d36e9b
Packit d36e9b
  --config)
Packit d36e9b
    ${SED} -e '1,/^# ### BEGIN LIBTOOL CONFIG/d' -e '/^# ### END LIBTOOL CONFIG/,$d' $progpath
Packit d36e9b
    # Now print the configurations for the tags.
Packit d36e9b
    for tagname in $taglist; do
Packit d36e9b
      ${SED} -n -e "/^# ### BEGIN LIBTOOL TAG CONFIG: $tagname$/,/^# ### END LIBTOOL TAG CONFIG: $tagname$/p" < "$progpath"
Packit d36e9b
    done
Packit d36e9b
    exit $?
Packit d36e9b
    ;;
Packit d36e9b
Packit d36e9b
  --debug)
Packit d36e9b
    $echo "$progname: enabling shell trace mode"
Packit d36e9b
    set -x
Packit d36e9b
    preserve_args="$preserve_args $arg"
Packit d36e9b
    ;;
Packit d36e9b
Packit d36e9b
  --dry-run | -n)
Packit d36e9b
    run=:
Packit d36e9b
    ;;
Packit d36e9b
Packit d36e9b
  --features)
Packit d36e9b
    $echo "host: $host"
Packit d36e9b
    if test "$build_libtool_libs" = yes; then
Packit d36e9b
      $echo "enable shared libraries"
Packit d36e9b
    else
Packit d36e9b
      $echo "disable shared libraries"
Packit d36e9b
    fi
Packit d36e9b
    if test "$build_old_libs" = yes; then
Packit d36e9b
      $echo "enable static libraries"
Packit d36e9b
    else
Packit d36e9b
      $echo "disable static libraries"
Packit d36e9b
    fi
Packit d36e9b
    exit $?
Packit d36e9b
    ;;
Packit d36e9b
Packit d36e9b
  --finish) mode="finish" ;;
Packit d36e9b
Packit d36e9b
  --mode) prevopt="--mode" prev=mode ;;
Packit d36e9b
  --mode=*) mode="$optarg" ;;
Packit d36e9b
Packit d36e9b
  --preserve-dup-deps) duplicate_deps="yes" ;;
Packit d36e9b
Packit d36e9b
  --quiet | --silent)
Packit d36e9b
    show=:
Packit d36e9b
    preserve_args="$preserve_args $arg"
Packit d36e9b
    ;;
Packit d36e9b
Packit d36e9b
  --tag)
Packit d36e9b
    prevopt="--tag"
Packit d36e9b
    prev=tag
Packit d36e9b
    preserve_args="$preserve_args --tag"
Packit d36e9b
    ;;
Packit d36e9b
  --tag=*)
Packit d36e9b
    set tag "$optarg" ${1+"$@"}
Packit d36e9b
    shift
Packit d36e9b
    prev=tag
Packit d36e9b
    preserve_args="$preserve_args --tag"
Packit d36e9b
    ;;
Packit d36e9b
Packit d36e9b
  -dlopen)
Packit d36e9b
    prevopt="-dlopen"
Packit d36e9b
    prev=execute_dlfiles
Packit d36e9b
    ;;
Packit d36e9b
Packit d36e9b
  -*)
Packit d36e9b
    $echo "$modename: unrecognized option \`$arg'" 1>&2
Packit d36e9b
    $echo "$help" 1>&2
Packit d36e9b
    exit $EXIT_FAILURE
Packit d36e9b
    ;;
Packit d36e9b
Packit d36e9b
  *)
Packit d36e9b
    nonopt="$arg"
Packit d36e9b
    break
Packit d36e9b
    ;;
Packit d36e9b
  esac
Packit d36e9b
done
Packit d36e9b
Packit d36e9b
if test -n "$prevopt"; then
Packit d36e9b
  $echo "$modename: option \`$prevopt' requires an argument" 1>&2
Packit d36e9b
  $echo "$help" 1>&2
Packit d36e9b
  exit $EXIT_FAILURE
Packit d36e9b
fi
Packit d36e9b
Packit d36e9b
case $disable_libs in
Packit d36e9b
no) 
Packit d36e9b
  ;;
Packit d36e9b
shared)
Packit d36e9b
  build_libtool_libs=no
Packit d36e9b
  build_old_libs=yes
Packit d36e9b
  ;;
Packit d36e9b
static)
Packit d36e9b
  build_old_libs=`case $build_libtool_libs in yes) echo no;; *) echo yes;; esac`
Packit d36e9b
  ;;
Packit d36e9b
esac
Packit d36e9b
Packit d36e9b
# If this variable is set in any of the actions, the command in it
Packit d36e9b
# will be execed at the end.  This prevents here-documents from being
Packit d36e9b
# left over by shells.
Packit d36e9b
exec_cmd=
Packit d36e9b
Packit d36e9b
if test -z "$show_help"; then
Packit d36e9b
Packit d36e9b
  # Infer the operation mode.
Packit d36e9b
  if test -z "$mode"; then
Packit d36e9b
    $echo "*** Warning: inferring the mode of operation is deprecated." 1>&2
Packit d36e9b
    $echo "*** Future versions of Libtool will require --mode=MODE be specified." 1>&2
Packit d36e9b
    case $nonopt in
Packit d36e9b
    *cc | cc* | *++ | gcc* | *-gcc* | g++* | xlc*)
Packit d36e9b
      mode=link
Packit d36e9b
      for arg
Packit d36e9b
      do
Packit d36e9b
	case $arg in
Packit d36e9b
	-c)
Packit d36e9b
	   mode=compile
Packit d36e9b
	   break
Packit d36e9b
	   ;;
Packit d36e9b
	esac
Packit d36e9b
      done
Packit d36e9b
      ;;
Packit d36e9b
    *db | *dbx | *strace | *truss)
Packit d36e9b
      mode=execute
Packit d36e9b
      ;;
Packit d36e9b
    *install*|cp|mv)
Packit d36e9b
      mode=install
Packit d36e9b
      ;;
Packit d36e9b
    *rm)
Packit d36e9b
      mode=uninstall
Packit d36e9b
      ;;
Packit d36e9b
    *)
Packit d36e9b
      # If we have no mode, but dlfiles were specified, then do execute mode.
Packit d36e9b
      test -n "$execute_dlfiles" && mode=execute
Packit d36e9b
Packit d36e9b
      # Just use the default operation mode.
Packit d36e9b
      if test -z "$mode"; then
Packit d36e9b
	if test -n "$nonopt"; then
Packit d36e9b
	  $echo "$modename: warning: cannot infer operation mode from \`$nonopt'" 1>&2
Packit d36e9b
	else
Packit d36e9b
	  $echo "$modename: warning: cannot infer operation mode without MODE-ARGS" 1>&2
Packit d36e9b
	fi
Packit d36e9b
      fi
Packit d36e9b
      ;;
Packit d36e9b
    esac
Packit d36e9b
  fi
Packit d36e9b
Packit d36e9b
  # Only execute mode is allowed to have -dlopen flags.
Packit d36e9b
  if test -n "$execute_dlfiles" && test "$mode" != execute; then
Packit d36e9b
    $echo "$modename: unrecognized option \`-dlopen'" 1>&2
Packit d36e9b
    $echo "$help" 1>&2
Packit d36e9b
    exit $EXIT_FAILURE
Packit d36e9b
  fi
Packit d36e9b
Packit d36e9b
  # Change the help message to a mode-specific one.
Packit d36e9b
  generic_help="$help"
Packit d36e9b
  help="Try \`$modename --help --mode=$mode' for more information."
Packit d36e9b
Packit d36e9b
  # These modes are in order of execution frequency so that they run quickly.
Packit d36e9b
  case $mode in
Packit d36e9b
  # libtool compile mode
Packit d36e9b
  compile)
Packit d36e9b
    modename="$modename: compile"
Packit d36e9b
    # Get the compilation command and the source file.
Packit d36e9b
    base_compile=
Packit d36e9b
    srcfile="$nonopt"  #  always keep a non-empty value in "srcfile"
Packit d36e9b
    suppress_opt=yes
Packit d36e9b
    suppress_output=
Packit d36e9b
    arg_mode=normal
Packit d36e9b
    libobj=
Packit d36e9b
    later=
Packit d36e9b
Packit d36e9b
    for arg
Packit d36e9b
    do
Packit d36e9b
      case $arg_mode in
Packit d36e9b
      arg  )
Packit d36e9b
	# do not "continue".  Instead, add this to base_compile
Packit d36e9b
	lastarg="$arg"
Packit d36e9b
	arg_mode=normal
Packit d36e9b
	;;
Packit d36e9b
Packit d36e9b
      target )
Packit d36e9b
	libobj="$arg"
Packit d36e9b
	arg_mode=normal
Packit d36e9b
	continue
Packit d36e9b
	;;
Packit d36e9b
Packit d36e9b
      normal )
Packit d36e9b
	# Accept any command-line options.
Packit d36e9b
	case $arg in
Packit d36e9b
	-o)
Packit d36e9b
	  if test -n "$libobj" ; then
Packit d36e9b
	    $echo "$modename: you cannot specify \`-o' more than once" 1>&2
Packit d36e9b
	    exit $EXIT_FAILURE
Packit d36e9b
	  fi
Packit d36e9b
	  arg_mode=target
Packit d36e9b
	  continue
Packit d36e9b
	  ;;
Packit d36e9b
Packit d36e9b
	-static | -prefer-pic | -prefer-non-pic)
Packit d36e9b
	  later="$later $arg"
Packit d36e9b
	  continue
Packit d36e9b
	  ;;
Packit d36e9b
Packit d36e9b
	-no-suppress)
Packit d36e9b
	  suppress_opt=no
Packit d36e9b
	  continue
Packit d36e9b
	  ;;
Packit d36e9b
Packit d36e9b
	-Xcompiler)
Packit d36e9b
	  arg_mode=arg  #  the next one goes into the "base_compile" arg list
Packit d36e9b
	  continue      #  The current "srcfile" will either be retained or
Packit d36e9b
	  ;;            #  replaced later.  I would guess that would be a bug.
Packit d36e9b
Packit d36e9b
	-Wc,*)
Packit d36e9b
	  args=`$echo "X$arg" | $Xsed -e "s/^-Wc,//"`
Packit d36e9b
	  lastarg=
Packit d36e9b
	  save_ifs="$IFS"; IFS=','
Packit d36e9b
 	  for arg in $args; do
Packit d36e9b
	    IFS="$save_ifs"
Packit d36e9b
Packit d36e9b
	    # Double-quote args containing other shell metacharacters.
Packit d36e9b
	    # Many Bourne shells cannot handle close brackets correctly
Packit d36e9b
	    # in scan sets, so we specify it separately.
Packit d36e9b
	    case $arg in
Packit d36e9b
	      *[\[\~\#\^\&\*\(\)\{\}\|\;\<\>\?\'\ \	]*|*]*|"")
Packit d36e9b
	      arg="\"$arg\""
Packit d36e9b
	      ;;
Packit d36e9b
	    esac
Packit d36e9b
	    lastarg="$lastarg $arg"
Packit d36e9b
	  done
Packit d36e9b
	  IFS="$save_ifs"
Packit d36e9b
	  lastarg=`$echo "X$lastarg" | $Xsed -e "s/^ //"`
Packit d36e9b
Packit d36e9b
	  # Add the arguments to base_compile.
Packit d36e9b
	  base_compile="$base_compile $lastarg"
Packit d36e9b
	  continue
Packit d36e9b
	  ;;
Packit d36e9b
Packit d36e9b
	* )
Packit d36e9b
	  # Accept the current argument as the source file.
Packit d36e9b
	  # The previous "srcfile" becomes the current argument.
Packit d36e9b
	  #
Packit d36e9b
	  lastarg="$srcfile"
Packit d36e9b
	  srcfile="$arg"
Packit d36e9b
	  ;;
Packit d36e9b
	esac  #  case $arg
Packit d36e9b
	;;
Packit d36e9b
      esac    #  case $arg_mode
Packit d36e9b
Packit d36e9b
      # Aesthetically quote the previous argument.
Packit d36e9b
      lastarg=`$echo "X$lastarg" | $Xsed -e "$sed_quote_subst"`
Packit d36e9b
Packit d36e9b
      case $lastarg in
Packit d36e9b
      # Double-quote args containing other shell metacharacters.
Packit d36e9b
      # Many Bourne shells cannot handle close brackets correctly
Packit d36e9b
      # in scan sets, and some SunOS ksh mistreat backslash-escaping
Packit d36e9b
      # in scan sets (worked around with variable expansion),
Packit d36e9b
      # and furthermore cannot handle '|' '&' '(' ')' in scan sets 
Packit d36e9b
      # at all, so we specify them separately.
Packit d36e9b
      *[\[\~\#\^\&\*\(\)\{\}\|\;\<\>\?\'\ \	]*|*]*|"")
Packit d36e9b
	lastarg="\"$lastarg\""
Packit d36e9b
	;;
Packit d36e9b
      esac
Packit d36e9b
Packit d36e9b
      base_compile="$base_compile $lastarg"
Packit d36e9b
    done # for arg
Packit d36e9b
Packit d36e9b
    case $arg_mode in
Packit d36e9b
    arg)
Packit d36e9b
      $echo "$modename: you must specify an argument for -Xcompile"
Packit d36e9b
      exit $EXIT_FAILURE
Packit d36e9b
      ;;
Packit d36e9b
    target)
Packit d36e9b
      $echo "$modename: you must specify a target with \`-o'" 1>&2
Packit d36e9b
      exit $EXIT_FAILURE
Packit d36e9b
      ;;
Packit d36e9b
    *)
Packit d36e9b
      # Get the name of the library object.
Packit d36e9b
      [ -z "$libobj" ] && libobj=`$echo "X$srcfile" | $Xsed -e 's%^.*/%%'`
Packit d36e9b
      ;;
Packit d36e9b
    esac
Packit d36e9b
Packit d36e9b
    # Recognize several different file suffixes.
Packit d36e9b
    # If the user specifies -o file.o, it is replaced with file.lo
Packit d36e9b
    xform='[cCFSifmso]'
Packit d36e9b
    case $libobj in
Packit d36e9b
    *.ada) xform=ada ;;
Packit d36e9b
    *.adb) xform=adb ;;
Packit d36e9b
    *.ads) xform=ads ;;
Packit d36e9b
    *.asm) xform=asm ;;
Packit d36e9b
    *.c++) xform=c++ ;;
Packit d36e9b
    *.cc) xform=cc ;;
Packit d36e9b
    *.ii) xform=ii ;;
Packit d36e9b
    *.class) xform=class ;;
Packit d36e9b
    *.cpp) xform=cpp ;;
Packit d36e9b
    *.cxx) xform=cxx ;;
Packit d36e9b
    *.f90) xform=f90 ;;
Packit d36e9b
    *.for) xform=for ;;
Packit d36e9b
    *.java) xform=java ;;
Packit d36e9b
    *.obj) xform=obj ;;
Packit d36e9b
    esac
Packit d36e9b
Packit d36e9b
    libobj=`$echo "X$libobj" | $Xsed -e "s/\.$xform$/.lo/"`
Packit d36e9b
Packit d36e9b
    case $libobj in
Packit d36e9b
    *.lo) obj=`$echo "X$libobj" | $Xsed -e "$lo2o"` ;;
Packit d36e9b
    *)
Packit d36e9b
      $echo "$modename: cannot determine name of library object from \`$libobj'" 1>&2
Packit d36e9b
      exit $EXIT_FAILURE
Packit d36e9b
      ;;
Packit d36e9b
    esac
Packit d36e9b
Packit d36e9b
    func_infer_tag $base_compile
Packit d36e9b
Packit d36e9b
    for arg in $later; do
Packit d36e9b
      case $arg in
Packit d36e9b
      -static)
Packit d36e9b
	build_old_libs=yes
Packit d36e9b
	continue
Packit d36e9b
	;;
Packit d36e9b
Packit d36e9b
      -prefer-pic)
Packit d36e9b
	pic_mode=yes
Packit d36e9b
	continue
Packit d36e9b
	;;
Packit d36e9b
Packit d36e9b
      -prefer-non-pic)
Packit d36e9b
	pic_mode=no
Packit d36e9b
	continue
Packit d36e9b
	;;
Packit d36e9b
      esac
Packit d36e9b
    done
Packit d36e9b
Packit d36e9b
    qlibobj=`$echo "X$libobj" | $Xsed -e "$sed_quote_subst"`
Packit d36e9b
    case $qlibobj in
Packit d36e9b
      *[\[\~\#\^\&\*\(\)\{\}\|\;\<\>\?\'\ \	]*|*]*|"")
Packit d36e9b
	qlibobj="\"$qlibobj\"" ;;
Packit d36e9b
    esac
Packit d36e9b
    test "X$libobj" != "X$qlibobj" \
Packit d36e9b
	&& $echo "X$libobj" | grep '[]~#^*{};<>?"'"'"' 	&()|`$[]' \
Packit d36e9b
	&& $echo "$modename: libobj name \`$libobj' may not contain shell special characters."
Packit d36e9b
    objname=`$echo "X$obj" | $Xsed -e 's%^.*/%%'`
Packit d36e9b
    xdir=`$echo "X$obj" | $Xsed -e 's%/[^/]*$%%'`
Packit d36e9b
    if test "X$xdir" = "X$obj"; then
Packit d36e9b
      xdir=
Packit d36e9b
    else
Packit d36e9b
      xdir=$xdir/
Packit d36e9b
    fi
Packit d36e9b
    lobj=${xdir}$objdir/$objname
Packit d36e9b
Packit d36e9b
    if test -z "$base_compile"; then
Packit d36e9b
      $echo "$modename: you must specify a compilation command" 1>&2
Packit d36e9b
      $echo "$help" 1>&2
Packit d36e9b
      exit $EXIT_FAILURE
Packit d36e9b
    fi
Packit d36e9b
Packit d36e9b
    # Delete any leftover library objects.
Packit d36e9b
    if test "$build_old_libs" = yes; then
Packit d36e9b
      removelist="$obj $lobj $libobj ${libobj}T"
Packit d36e9b
    else
Packit d36e9b
      removelist="$lobj $libobj ${libobj}T"
Packit d36e9b
    fi
Packit d36e9b
Packit d36e9b
    $run $rm $removelist
Packit d36e9b
    trap "$run $rm $removelist; exit $EXIT_FAILURE" 1 2 15
Packit d36e9b
Packit d36e9b
    # On Cygwin there's no "real" PIC flag so we must build both object types
Packit d36e9b
    case $host_os in
Packit d36e9b
    cygwin* | mingw* | pw32* | os2*)
Packit d36e9b
      pic_mode=default
Packit d36e9b
      ;;
Packit d36e9b
    esac
Packit d36e9b
    if test "$pic_mode" = no && test "$deplibs_check_method" != pass_all; then
Packit d36e9b
      # non-PIC code in shared libraries is not supported
Packit d36e9b
      pic_mode=default
Packit d36e9b
    fi
Packit d36e9b
Packit d36e9b
    # Calculate the filename of the output object if compiler does
Packit d36e9b
    # not support -o with -c
Packit d36e9b
    if test "$compiler_c_o" = no; then
Packit d36e9b
      output_obj=`$echo "X$srcfile" | $Xsed -e 's%^.*/%%' -e 's%\.[^.]*$%%'`.${objext}
Packit d36e9b
      lockfile="$output_obj.lock"
Packit d36e9b
      removelist="$removelist $output_obj $lockfile"
Packit d36e9b
      trap "$run $rm $removelist; exit $EXIT_FAILURE" 1 2 15
Packit d36e9b
    else
Packit d36e9b
      output_obj=
Packit d36e9b
      need_locks=no
Packit d36e9b
      lockfile=
Packit d36e9b
    fi
Packit d36e9b
Packit d36e9b
    # Lock this critical section if it is needed
Packit d36e9b
    # We use this script file to make the link, it avoids creating a new file
Packit d36e9b
    if test "$need_locks" = yes; then
Packit d36e9b
      until $run ln "$progpath" "$lockfile" 2>/dev/null; do
Packit d36e9b
	$show "Waiting for $lockfile to be removed"
Packit d36e9b
	sleep 2
Packit d36e9b
      done
Packit d36e9b
    elif test "$need_locks" = warn; then
Packit d36e9b
      if test -f "$lockfile"; then
Packit d36e9b
	$echo "\
Packit d36e9b
*** ERROR, $lockfile exists and contains:
Packit d36e9b
`cat $lockfile 2>/dev/null`
Packit d36e9b
Packit d36e9b
This indicates that another process is trying to use the same
Packit d36e9b
temporary object file, and libtool could not work around it because
Packit d36e9b
your compiler does not support \`-c' and \`-o' together.  If you
Packit d36e9b
repeat this compilation, it may succeed, by chance, but you had better
Packit d36e9b
avoid parallel builds (make -j) in this platform, or get a better
Packit d36e9b
compiler."
Packit d36e9b
Packit d36e9b
	$run $rm $removelist
Packit d36e9b
	exit $EXIT_FAILURE
Packit d36e9b
      fi
Packit d36e9b
      $echo "$srcfile" > "$lockfile"
Packit d36e9b
    fi
Packit d36e9b
Packit d36e9b
    if test -n "$fix_srcfile_path"; then
Packit d36e9b
      eval srcfile=\"$fix_srcfile_path\"
Packit d36e9b
    fi
Packit d36e9b
    qsrcfile=`$echo "X$srcfile" | $Xsed -e "$sed_quote_subst"`
Packit d36e9b
    case $qsrcfile in
Packit d36e9b
      *[\[\~\#\^\&\*\(\)\{\}\|\;\<\>\?\'\ \	]*|*]*|"")
Packit d36e9b
      qsrcfile="\"$qsrcfile\"" ;;
Packit d36e9b
    esac
Packit d36e9b
Packit d36e9b
    $run $rm "$libobj" "${libobj}T"
Packit d36e9b
Packit d36e9b
    # Create a libtool object file (analogous to a ".la" file),
Packit d36e9b
    # but don't create it if we're doing a dry run.
Packit d36e9b
    test -z "$run" && cat > ${libobj}T <
Packit d36e9b
# $libobj - a libtool object file
Packit d36e9b
# Generated by $PROGRAM - GNU $PACKAGE $VERSION$TIMESTAMP
Packit d36e9b
#
Packit d36e9b
# Please DO NOT delete this file!
Packit d36e9b
# It is necessary for linking the library.
Packit d36e9b
Packit d36e9b
# Name of the PIC object.
Packit d36e9b
EOF
Packit d36e9b
Packit d36e9b
    # Only build a PIC object if we are building libtool libraries.
Packit d36e9b
    if test "$build_libtool_libs" = yes; then
Packit d36e9b
      # Without this assignment, base_compile gets emptied.
Packit d36e9b
      fbsd_hideous_sh_bug=$base_compile
Packit d36e9b
Packit d36e9b
      if test "$pic_mode" != no; then
Packit d36e9b
	command="$base_compile $qsrcfile $pic_flag"
Packit d36e9b
      else
Packit d36e9b
	# Don't build PIC code
Packit d36e9b
	command="$base_compile $qsrcfile"
Packit d36e9b
      fi
Packit d36e9b
Packit d36e9b
      if test ! -d "${xdir}$objdir"; then
Packit d36e9b
	$show "$mkdir ${xdir}$objdir"
Packit d36e9b
	$run $mkdir ${xdir}$objdir
Packit d36e9b
	exit_status=$?
Packit d36e9b
	if test "$exit_status" -ne 0 && test ! -d "${xdir}$objdir"; then
Packit d36e9b
	  exit $exit_status
Packit d36e9b
	fi
Packit d36e9b
      fi
Packit d36e9b
Packit d36e9b
      if test -z "$output_obj"; then
Packit d36e9b
	# Place PIC objects in $objdir
Packit d36e9b
	command="$command -o $lobj"
Packit d36e9b
      fi
Packit d36e9b
Packit d36e9b
      $run $rm "$lobj" "$output_obj"
Packit d36e9b
Packit d36e9b
      $show "$command"
Packit d36e9b
      if $run eval "$command"; then :
Packit d36e9b
      else
Packit d36e9b
	test -n "$output_obj" && $run $rm $removelist
Packit d36e9b
	exit $EXIT_FAILURE
Packit d36e9b
      fi
Packit d36e9b
Packit d36e9b
      if test "$need_locks" = warn &&
Packit d36e9b
	 test "X`cat $lockfile 2>/dev/null`" != "X$srcfile"; then
Packit d36e9b
	$echo "\
Packit d36e9b
*** ERROR, $lockfile contains:
Packit d36e9b
`cat $lockfile 2>/dev/null`
Packit d36e9b
Packit d36e9b
but it should contain:
Packit d36e9b
$srcfile
Packit d36e9b
Packit d36e9b
This indicates that another process is trying to use the same
Packit d36e9b
temporary object file, and libtool could not work around it because
Packit d36e9b
your compiler does not support \`-c' and \`-o' together.  If you
Packit d36e9b
repeat this compilation, it may succeed, by chance, but you had better
Packit d36e9b
avoid parallel builds (make -j) in this platform, or get a better
Packit d36e9b
compiler."
Packit d36e9b
Packit d36e9b
	$run $rm $removelist
Packit d36e9b
	exit $EXIT_FAILURE
Packit d36e9b
      fi
Packit d36e9b
Packit d36e9b
      # Just move the object if needed, then go on to compile the next one
Packit d36e9b
      if test -n "$output_obj" && test "X$output_obj" != "X$lobj"; then
Packit d36e9b
	$show "$mv $output_obj $lobj"
Packit d36e9b
	if $run $mv $output_obj $lobj; then :
Packit d36e9b
	else
Packit d36e9b
	  error=$?
Packit d36e9b
	  $run $rm $removelist
Packit d36e9b
	  exit $error
Packit d36e9b
	fi
Packit d36e9b
      fi
Packit d36e9b
Packit d36e9b
      # Append the name of the PIC object to the libtool object file.
Packit d36e9b
      test -z "$run" && cat >> ${libobj}T <
Packit d36e9b
pic_object='$objdir/$objname'
Packit d36e9b
Packit d36e9b
EOF
Packit d36e9b
Packit d36e9b
      # Allow error messages only from the first compilation.
Packit d36e9b
      if test "$suppress_opt" = yes; then
Packit d36e9b
        suppress_output=' >/dev/null 2>&1'
Packit d36e9b
      fi
Packit d36e9b
    else
Packit d36e9b
      # No PIC object so indicate it doesn't exist in the libtool
Packit d36e9b
      # object file.
Packit d36e9b
      test -z "$run" && cat >> ${libobj}T <
Packit d36e9b
pic_object=none
Packit d36e9b
Packit d36e9b
EOF
Packit d36e9b
    fi
Packit d36e9b
Packit d36e9b
    # Only build a position-dependent object if we build old libraries.
Packit d36e9b
    if test "$build_old_libs" = yes; then
Packit d36e9b
      if test "$pic_mode" != yes; then
Packit d36e9b
	# Don't build PIC code
Packit d36e9b
	command="$base_compile $qsrcfile"
Packit d36e9b
      else
Packit d36e9b
	command="$base_compile $qsrcfile $pic_flag"
Packit d36e9b
      fi
Packit d36e9b
      if test "$compiler_c_o" = yes; then
Packit d36e9b
	command="$command -o $obj"
Packit d36e9b
      fi
Packit d36e9b
Packit d36e9b
      # Suppress compiler output if we already did a PIC compilation.
Packit d36e9b
      command="$command$suppress_output"
Packit d36e9b
      $run $rm "$obj" "$output_obj"
Packit d36e9b
      $show "$command"
Packit d36e9b
      if $run eval "$command"; then :
Packit d36e9b
      else
Packit d36e9b
	$run $rm $removelist
Packit d36e9b
	exit $EXIT_FAILURE
Packit d36e9b
      fi
Packit d36e9b
Packit d36e9b
      if test "$need_locks" = warn &&
Packit d36e9b
	 test "X`cat $lockfile 2>/dev/null`" != "X$srcfile"; then
Packit d36e9b
	$echo "\
Packit d36e9b
*** ERROR, $lockfile contains:
Packit d36e9b
`cat $lockfile 2>/dev/null`
Packit d36e9b
Packit d36e9b
but it should contain:
Packit d36e9b
$srcfile
Packit d36e9b
Packit d36e9b
This indicates that another process is trying to use the same
Packit d36e9b
temporary object file, and libtool could not work around it because
Packit d36e9b
your compiler does not support \`-c' and \`-o' together.  If you
Packit d36e9b
repeat this compilation, it may succeed, by chance, but you had better
Packit d36e9b
avoid parallel builds (make -j) in this platform, or get a better
Packit d36e9b
compiler."
Packit d36e9b
Packit d36e9b
	$run $rm $removelist
Packit d36e9b
	exit $EXIT_FAILURE
Packit d36e9b
      fi
Packit d36e9b
Packit d36e9b
      # Just move the object if needed
Packit d36e9b
      if test -n "$output_obj" && test "X$output_obj" != "X$obj"; then
Packit d36e9b
	$show "$mv $output_obj $obj"
Packit d36e9b
	if $run $mv $output_obj $obj; then :
Packit d36e9b
	else
Packit d36e9b
	  error=$?
Packit d36e9b
	  $run $rm $removelist
Packit d36e9b
	  exit $error
Packit d36e9b
	fi
Packit d36e9b
      fi
Packit d36e9b
Packit d36e9b
      # Append the name of the non-PIC object the libtool object file.
Packit d36e9b
      # Only append if the libtool object file exists.
Packit d36e9b
      test -z "$run" && cat >> ${libobj}T <
Packit d36e9b
# Name of the non-PIC object.
Packit d36e9b
non_pic_object='$objname'
Packit d36e9b
Packit d36e9b
EOF
Packit d36e9b
    else
Packit d36e9b
      # Append the name of the non-PIC object the libtool object file.
Packit d36e9b
      # Only append if the libtool object file exists.
Packit d36e9b
      test -z "$run" && cat >> ${libobj}T <
Packit d36e9b
# Name of the non-PIC object.
Packit d36e9b
non_pic_object=none
Packit d36e9b
Packit d36e9b
EOF
Packit d36e9b
    fi
Packit d36e9b
Packit d36e9b
    $run $mv "${libobj}T" "${libobj}"
Packit d36e9b
Packit d36e9b
    # Unlock the critical section if it was locked
Packit d36e9b
    if test "$need_locks" != no; then
Packit d36e9b
      $run $rm "$lockfile"
Packit d36e9b
    fi
Packit d36e9b
Packit d36e9b
    exit $EXIT_SUCCESS
Packit d36e9b
    ;;
Packit d36e9b
Packit d36e9b
  # libtool link mode
Packit d36e9b
  link | relink)
Packit d36e9b
    modename="$modename: link"
Packit d36e9b
    case $host in
Packit d36e9b
    *-*-cygwin* | *-*-mingw* | *-*-pw32* | *-*-os2*)
Packit d36e9b
      # It is impossible to link a dll without this setting, and
Packit d36e9b
      # we shouldn't force the makefile maintainer to figure out
Packit d36e9b
      # which system we are compiling for in order to pass an extra
Packit d36e9b
      # flag for every libtool invocation.
Packit d36e9b
      # allow_undefined=no
Packit d36e9b
Packit d36e9b
      # FIXME: Unfortunately, there are problems with the above when trying
Packit d36e9b
      # to make a dll which has undefined symbols, in which case not
Packit d36e9b
      # even a static library is built.  For now, we need to specify
Packit d36e9b
      # -no-undefined on the libtool link line when we can be certain
Packit d36e9b
      # that all symbols are satisfied, otherwise we get a static library.
Packit d36e9b
      allow_undefined=yes
Packit d36e9b
      ;;
Packit d36e9b
    *)
Packit d36e9b
      allow_undefined=yes
Packit d36e9b
      ;;
Packit d36e9b
    esac
Packit d36e9b
    libtool_args="$nonopt"
Packit d36e9b
    base_compile="$nonopt $@"
Packit d36e9b
    compile_command="$nonopt"
Packit d36e9b
    finalize_command="$nonopt"
Packit d36e9b
Packit d36e9b
    compile_rpath=
Packit d36e9b
    finalize_rpath=
Packit d36e9b
    compile_shlibpath=
Packit d36e9b
    finalize_shlibpath=
Packit d36e9b
    convenience=
Packit d36e9b
    old_convenience=
Packit d36e9b
    deplibs=
Packit d36e9b
    old_deplibs=
Packit d36e9b
    compiler_flags=
Packit d36e9b
    linker_flags=
Packit d36e9b
    dllsearchpath=
Packit d36e9b
    lib_search_path=`pwd`
Packit d36e9b
    inst_prefix_dir=
Packit d36e9b
Packit d36e9b
    avoid_version=no
Packit d36e9b
    dlfiles=
Packit d36e9b
    dlprefiles=
Packit d36e9b
    dlself=no
Packit d36e9b
    export_dynamic=no
Packit d36e9b
    export_symbols=
Packit d36e9b
    export_symbols_regex=
Packit d36e9b
    generated=
Packit d36e9b
    libobjs=
Packit d36e9b
    ltlibs=
Packit d36e9b
    module=no
Packit d36e9b
    no_install=no
Packit d36e9b
    objs=
Packit d36e9b
    non_pic_objects=
Packit d36e9b
    notinst_path= # paths that contain not-installed libtool libraries
Packit d36e9b
    precious_files_regex=
Packit d36e9b
    prefer_static_libs=no
Packit d36e9b
    preload=no
Packit d36e9b
    prev=
Packit d36e9b
    prevarg=
Packit d36e9b
    release=
Packit d36e9b
    rpath=
Packit d36e9b
    xrpath=
Packit d36e9b
    perm_rpath=
Packit d36e9b
    temp_rpath=
Packit d36e9b
    thread_safe=no
Packit d36e9b
    vinfo=
Packit d36e9b
    vinfo_number=no
Packit d36e9b
Packit d36e9b
    func_infer_tag $base_compile
Packit d36e9b
Packit d36e9b
    # We need to know -static, to get the right output filenames.
Packit d36e9b
    for arg
Packit d36e9b
    do
Packit d36e9b
      case $arg in
Packit d36e9b
      -all-static | -static | -static-libtool-libs)
Packit d36e9b
    case $arg in
Packit d36e9b
    -all-static)
Packit d36e9b
	  if test "$build_libtool_libs" = yes && test -z "$link_static_flag"; then
Packit d36e9b
	    $echo "$modename: warning: complete static linking is impossible in this configuration" 1>&2
Packit d36e9b
	  fi
Packit d36e9b
	  if test -n "$link_static_flag"; then
Packit d36e9b
	    dlopen_self=$dlopen_self_static
Packit d36e9b
	  fi
Packit d36e9b
	  prefer_static_libs=yes
Packit d36e9b
	  ;;
Packit d36e9b
    -static)
Packit d36e9b
	  if test -z "$pic_flag" && test -n "$link_static_flag"; then
Packit d36e9b
	    dlopen_self=$dlopen_self_static
Packit d36e9b
	  fi
Packit d36e9b
	  prefer_static_libs=built
Packit d36e9b
	  ;;
Packit d36e9b
    -static-libtool-libs)
Packit d36e9b
      if test -z "$pic_flag" && test -n "$link_static_flag"; then
Packit d36e9b
        dlopen_self=$dlopen_self_static
Packit d36e9b
      fi
Packit d36e9b
      prefer_static_libs=yes
Packit d36e9b
      ;;
Packit d36e9b
    esac
Packit d36e9b
	build_libtool_libs=no
Packit d36e9b
	build_old_libs=yes
Packit d36e9b
	break
Packit d36e9b
	;;
Packit d36e9b
      esac
Packit d36e9b
    done
Packit d36e9b
Packit d36e9b
    # See if our shared archives depend on static archives.
Packit d36e9b
    test -n "$old_archive_from_new_cmds" && build_old_libs=yes
Packit d36e9b
Packit d36e9b
    # Go through the arguments, transforming them on the way.
Packit d36e9b
    while test "$#" -gt 0; do
Packit d36e9b
      arg="$1"
Packit d36e9b
      shift
Packit d36e9b
      case $arg in
Packit d36e9b
      *[\[\~\#\^\&\*\(\)\{\}\|\;\<\>\?\'\ \	]*|*]*|"")
Packit d36e9b
	qarg=\"`$echo "X$arg" | $Xsed -e "$sed_quote_subst"`\" ### testsuite: skip nested quoting test
Packit d36e9b
	;;
Packit d36e9b
      *) qarg=$arg ;;
Packit d36e9b
      esac
Packit d36e9b
      libtool_args="$libtool_args $qarg"
Packit d36e9b
Packit d36e9b
      # If the previous option needs an argument, assign it.
Packit d36e9b
      if test -n "$prev"; then
Packit d36e9b
	case $prev in
Packit d36e9b
	output)
Packit d36e9b
	  compile_command="$compile_command @OUTPUT@"
Packit d36e9b
	  finalize_command="$finalize_command @OUTPUT@"
Packit d36e9b
	  ;;
Packit d36e9b
	esac
Packit d36e9b
Packit d36e9b
	case $prev in
Packit d36e9b
	dlfiles|dlprefiles)
Packit d36e9b
	  if test "$preload" = no; then
Packit d36e9b
	    # Add the symbol object into the linking commands.
Packit d36e9b
	    compile_command="$compile_command @SYMFILE@"
Packit d36e9b
	    finalize_command="$finalize_command @SYMFILE@"
Packit d36e9b
	    preload=yes
Packit d36e9b
	  fi
Packit d36e9b
	  case $arg in
Packit d36e9b
	  *.la | *.lo) ;;  # We handle these cases below.
Packit d36e9b
	  force)
Packit d36e9b
	    if test "$dlself" = no; then
Packit d36e9b
	      dlself=needless
Packit d36e9b
	      export_dynamic=yes
Packit d36e9b
	    fi
Packit d36e9b
	    prev=
Packit d36e9b
	    continue
Packit d36e9b
	    ;;
Packit d36e9b
	  self)
Packit d36e9b
	    if test "$prev" = dlprefiles; then
Packit d36e9b
	      dlself=yes
Packit d36e9b
	    elif test "$prev" = dlfiles && test "$dlopen_self" != yes; then
Packit d36e9b
	      dlself=yes
Packit d36e9b
	    else
Packit d36e9b
	      dlself=needless
Packit d36e9b
	      export_dynamic=yes
Packit d36e9b
	    fi
Packit d36e9b
	    prev=
Packit d36e9b
	    continue
Packit d36e9b
	    ;;
Packit d36e9b
	  *)
Packit d36e9b
	    if test "$prev" = dlfiles; then
Packit d36e9b
	      dlfiles="$dlfiles $arg"
Packit d36e9b
	    else
Packit d36e9b
	      dlprefiles="$dlprefiles $arg"
Packit d36e9b
	    fi
Packit d36e9b
	    prev=
Packit d36e9b
	    continue
Packit d36e9b
	    ;;
Packit d36e9b
	  esac
Packit d36e9b
	  ;;
Packit d36e9b
	expsyms)
Packit d36e9b
	  export_symbols="$arg"
Packit d36e9b
	  if test ! -f "$arg"; then
Packit d36e9b
	    $echo "$modename: symbol file \`$arg' does not exist"
Packit d36e9b
	    exit $EXIT_FAILURE
Packit d36e9b
	  fi
Packit d36e9b
	  prev=
Packit d36e9b
	  continue
Packit d36e9b
	  ;;
Packit d36e9b
	expsyms_regex)
Packit d36e9b
	  export_symbols_regex="$arg"
Packit d36e9b
	  prev=
Packit d36e9b
	  continue
Packit d36e9b
	  ;;
Packit d36e9b
	inst_prefix)
Packit d36e9b
	  inst_prefix_dir="$arg"
Packit d36e9b
	  prev=
Packit d36e9b
	  continue
Packit d36e9b
	  ;;
Packit d36e9b
	precious_regex)
Packit d36e9b
	  precious_files_regex="$arg"
Packit d36e9b
	  prev=
Packit d36e9b
	  continue
Packit d36e9b
	  ;;
Packit d36e9b
	release)
Packit d36e9b
	  release="-$arg"
Packit d36e9b
	  prev=
Packit d36e9b
	  continue
Packit d36e9b
	  ;;
Packit d36e9b
	objectlist)
Packit d36e9b
	  if test -f "$arg"; then
Packit d36e9b
	    save_arg=$arg
Packit d36e9b
	    moreargs=
Packit d36e9b
	    for fil in `cat $save_arg`
Packit d36e9b
	    do
Packit d36e9b
#	      moreargs="$moreargs $fil"
Packit d36e9b
	      arg=$fil
Packit d36e9b
	      # A libtool-controlled object.
Packit d36e9b
Packit d36e9b
	      # Check to see that this really is a libtool object.
Packit d36e9b
	      if (${SED} -e '2q' $arg | grep "^# Generated by .*$PACKAGE") >/dev/null 2>&1; then
Packit d36e9b
		pic_object=
Packit d36e9b
		non_pic_object=
Packit d36e9b
Packit d36e9b
		# Read the .lo file
Packit d36e9b
		# If there is no directory component, then add one.
Packit d36e9b
		case $arg in
Packit d36e9b
		*/* | *\\*) . $arg ;;
Packit d36e9b
		*) . ./$arg ;;
Packit d36e9b
		esac
Packit d36e9b
Packit d36e9b
		if test -z "$pic_object" || \
Packit d36e9b
		   test -z "$non_pic_object" ||
Packit d36e9b
		   test "$pic_object" = none && \
Packit d36e9b
		   test "$non_pic_object" = none; then
Packit d36e9b
		  $echo "$modename: cannot find name of object for \`$arg'" 1>&2
Packit d36e9b
		  exit $EXIT_FAILURE
Packit d36e9b
		fi
Packit d36e9b
Packit d36e9b
		# Extract subdirectory from the argument.
Packit d36e9b
		xdir=`$echo "X$arg" | $Xsed -e 's%/[^/]*$%%'`
Packit d36e9b
		if test "X$xdir" = "X$arg"; then
Packit d36e9b
		  xdir=
Packit d36e9b
		else
Packit d36e9b
		  xdir="$xdir/"
Packit d36e9b
		fi
Packit d36e9b
Packit d36e9b
		if test "$pic_object" != none; then
Packit d36e9b
		  # Prepend the subdirectory the object is found in.
Packit d36e9b
		  pic_object="$xdir$pic_object"
Packit d36e9b
Packit d36e9b
		  if test "$prev" = dlfiles; then
Packit d36e9b
		    if test "$build_libtool_libs" = yes && test "$dlopen_support" = yes; then
Packit d36e9b
		      dlfiles="$dlfiles $pic_object"
Packit d36e9b
		      prev=
Packit d36e9b
		      continue
Packit d36e9b
		    else
Packit d36e9b
		      # If libtool objects are unsupported, then we need to preload.
Packit d36e9b
		      prev=dlprefiles
Packit d36e9b
		    fi
Packit d36e9b
		  fi
Packit d36e9b
Packit d36e9b
		  # CHECK ME:  I think I busted this.  -Ossama
Packit d36e9b
		  if test "$prev" = dlprefiles; then
Packit d36e9b
		    # Preload the old-style object.
Packit d36e9b
		    dlprefiles="$dlprefiles $pic_object"
Packit d36e9b
		    prev=
Packit d36e9b
		  fi
Packit d36e9b
Packit d36e9b
		  # A PIC object.
Packit d36e9b
		  libobjs="$libobjs $pic_object"
Packit d36e9b
		  arg="$pic_object"
Packit d36e9b
		fi
Packit d36e9b
Packit d36e9b
		# Non-PIC object.
Packit d36e9b
		if test "$non_pic_object" != none; then
Packit d36e9b
		  # Prepend the subdirectory the object is found in.
Packit d36e9b
		  non_pic_object="$xdir$non_pic_object"
Packit d36e9b
Packit d36e9b
		  # A standard non-PIC object
Packit d36e9b
		  non_pic_objects="$non_pic_objects $non_pic_object"
Packit d36e9b
		  if test -z "$pic_object" || test "$pic_object" = none ; then
Packit d36e9b
		    arg="$non_pic_object"
Packit d36e9b
		  fi
Packit d36e9b
		else
Packit d36e9b
		  # If the PIC object exists, use it instead.
Packit d36e9b
		  # $xdir was prepended to $pic_object above.
Packit d36e9b
		  non_pic_object="$pic_object"
Packit d36e9b
		  non_pic_objects="$non_pic_objects $non_pic_object"
Packit d36e9b
		fi
Packit d36e9b
	      else
Packit d36e9b
		# Only an error if not doing a dry-run.
Packit d36e9b
		if test -z "$run"; then
Packit d36e9b
		  $echo "$modename: \`$arg' is not a valid libtool object" 1>&2
Packit d36e9b
		  exit $EXIT_FAILURE
Packit d36e9b
		else
Packit d36e9b
		  # Dry-run case.
Packit d36e9b
Packit d36e9b
		  # Extract subdirectory from the argument.
Packit d36e9b
		  xdir=`$echo "X$arg" | $Xsed -e 's%/[^/]*$%%'`
Packit d36e9b
		  if test "X$xdir" = "X$arg"; then
Packit d36e9b
		    xdir=
Packit d36e9b
		  else
Packit d36e9b
		    xdir="$xdir/"
Packit d36e9b
		  fi
Packit d36e9b
Packit d36e9b
		  pic_object=`$echo "X${xdir}${objdir}/${arg}" | $Xsed -e "$lo2o"`
Packit d36e9b
		  non_pic_object=`$echo "X${xdir}${arg}" | $Xsed -e "$lo2o"`
Packit d36e9b
		  libobjs="$libobjs $pic_object"
Packit d36e9b
		  non_pic_objects="$non_pic_objects $non_pic_object"
Packit d36e9b
		fi
Packit d36e9b
	      fi
Packit d36e9b
	    done
Packit d36e9b
	  else
Packit d36e9b
	    $echo "$modename: link input file \`$save_arg' does not exist"
Packit d36e9b
	    exit $EXIT_FAILURE
Packit d36e9b
	  fi
Packit d36e9b
	  arg=$save_arg
Packit d36e9b
	  prev=
Packit d36e9b
	  continue
Packit d36e9b
	  ;;
Packit d36e9b
	rpath | xrpath)
Packit d36e9b
	  # We need an absolute path.
Packit d36e9b
	  case $arg in
Packit d36e9b
	  [\\/]* | [A-Za-z]:[\\/]*) ;;
Packit d36e9b
	  *)
Packit d36e9b
	    $echo "$modename: only absolute run-paths are allowed" 1>&2
Packit d36e9b
	    exit $EXIT_FAILURE
Packit d36e9b
	    ;;
Packit d36e9b
	  esac
Packit d36e9b
	  if test "$prev" = rpath; then
Packit d36e9b
	    case "$rpath " in
Packit d36e9b
	    *" $arg "*) ;;
Packit d36e9b
	    *) rpath="$rpath $arg" ;;
Packit d36e9b
	    esac
Packit d36e9b
	  else
Packit d36e9b
	    case "$xrpath " in
Packit d36e9b
	    *" $arg "*) ;;
Packit d36e9b
	    *) xrpath="$xrpath $arg" ;;
Packit d36e9b
	    esac
Packit d36e9b
	  fi
Packit d36e9b
	  prev=
Packit d36e9b
	  continue
Packit d36e9b
	  ;;
Packit d36e9b
	xcompiler)
Packit d36e9b
	  compiler_flags="$compiler_flags $qarg"
Packit d36e9b
	  prev=
Packit d36e9b
	  compile_command="$compile_command $qarg"
Packit d36e9b
	  finalize_command="$finalize_command $qarg"
Packit d36e9b
	  continue
Packit d36e9b
	  ;;
Packit d36e9b
	xlinker)
Packit d36e9b
	  linker_flags="$linker_flags $qarg"
Packit d36e9b
	  compiler_flags="$compiler_flags $wl$qarg"
Packit d36e9b
	  prev=
Packit d36e9b
	  compile_command="$compile_command $wl$qarg"
Packit d36e9b
	  finalize_command="$finalize_command $wl$qarg"
Packit d36e9b
	  continue
Packit d36e9b
	  ;;
Packit d36e9b
	xcclinker)
Packit d36e9b
	  linker_flags="$linker_flags $qarg"
Packit d36e9b
	  compiler_flags="$compiler_flags $qarg"
Packit d36e9b
	  prev=
Packit d36e9b
	  compile_command="$compile_command $qarg"
Packit d36e9b
	  finalize_command="$finalize_command $qarg"
Packit d36e9b
	  continue
Packit d36e9b
	  ;;
Packit d36e9b
	shrext)
Packit d36e9b
  	  shrext_cmds="$arg"
Packit d36e9b
	  prev=
Packit d36e9b
	  continue
Packit d36e9b
	  ;;
Packit d36e9b
	darwin_framework|darwin_framework_skip)
Packit d36e9b
	  test "$prev" = "darwin_framework" && compiler_flags="$compiler_flags $arg"
Packit d36e9b
	  compile_command="$compile_command $arg"
Packit d36e9b
	  finalize_command="$finalize_command $arg"
Packit d36e9b
	  prev=
Packit d36e9b
	  continue
Packit d36e9b
	  ;;
Packit d36e9b
	*)
Packit d36e9b
	  eval "$prev=\"\$arg\""
Packit d36e9b
	  prev=
Packit d36e9b
	  continue
Packit d36e9b
	  ;;
Packit d36e9b
	esac
Packit d36e9b
      fi # test -n "$prev"
Packit d36e9b
Packit d36e9b
      prevarg="$arg"
Packit d36e9b
Packit d36e9b
      case $arg in
Packit d36e9b
      -all-static)
Packit d36e9b
	if test -n "$link_static_flag"; then
Packit d36e9b
	  compile_command="$compile_command $link_static_flag"
Packit d36e9b
	  finalize_command="$finalize_command $link_static_flag"
Packit d36e9b
	fi
Packit d36e9b
	continue
Packit d36e9b
	;;
Packit d36e9b
Packit d36e9b
      -allow-undefined)
Packit d36e9b
	# FIXME: remove this flag sometime in the future.
Packit d36e9b
	$echo "$modename: \`-allow-undefined' is deprecated because it is the default" 1>&2
Packit d36e9b
	continue
Packit d36e9b
	;;
Packit d36e9b
Packit d36e9b
      -avoid-version)
Packit d36e9b
	avoid_version=yes
Packit d36e9b
	continue
Packit d36e9b
	;;
Packit d36e9b
Packit d36e9b
      -dlopen)
Packit d36e9b
	prev=dlfiles
Packit d36e9b
	continue
Packit d36e9b
	;;
Packit d36e9b
Packit d36e9b
      -dlpreopen)
Packit d36e9b
	prev=dlprefiles
Packit d36e9b
	continue
Packit d36e9b
	;;
Packit d36e9b
Packit d36e9b
      -export-dynamic)
Packit d36e9b
	export_dynamic=yes
Packit d36e9b
	continue
Packit d36e9b
	;;
Packit d36e9b
Packit d36e9b
      -export-symbols | -export-symbols-regex)
Packit d36e9b
	if test -n "$export_symbols" || test -n "$export_symbols_regex"; then
Packit d36e9b
	  $echo "$modename: more than one -exported-symbols argument is not allowed"
Packit d36e9b
	  exit $EXIT_FAILURE
Packit d36e9b
	fi
Packit d36e9b
	if test "X$arg" = "X-export-symbols"; then
Packit d36e9b
	  prev=expsyms
Packit d36e9b
	else
Packit d36e9b
	  prev=expsyms_regex
Packit d36e9b
	fi
Packit d36e9b
	continue
Packit d36e9b
	;;
Packit d36e9b
Packit d36e9b
      -framework|-arch|-isysroot)
Packit d36e9b
	case " $CC " in
Packit d36e9b
	  *" ${arg} ${1} "* | *" ${arg}	${1} "*) 
Packit d36e9b
		prev=darwin_framework_skip ;;
Packit d36e9b
	  *) compiler_flags="$compiler_flags $arg"
Packit d36e9b
	     prev=darwin_framework ;;
Packit d36e9b
	esac
Packit d36e9b
	compile_command="$compile_command $arg"
Packit d36e9b
	finalize_command="$finalize_command $arg"
Packit d36e9b
	continue
Packit d36e9b
	;;
Packit d36e9b
Packit d36e9b
      -inst-prefix-dir)
Packit d36e9b
	prev=inst_prefix
Packit d36e9b
	continue
Packit d36e9b
	;;
Packit d36e9b
Packit d36e9b
      # The native IRIX linker understands -LANG:*, -LIST:* and -LNO:*
Packit d36e9b
      # so, if we see these flags be careful not to treat them like -L
Packit d36e9b
      -L[A-Z][A-Z]*:*)
Packit d36e9b
	case $with_gcc/$host in
Packit d36e9b
	no/*-*-irix* | /*-*-irix*)
Packit d36e9b
	  compile_command="$compile_command $arg"
Packit d36e9b
	  finalize_command="$finalize_command $arg"
Packit d36e9b
	  ;;
Packit d36e9b
	esac
Packit d36e9b
	continue
Packit d36e9b
	;;
Packit d36e9b
Packit d36e9b
      -L*)
Packit d36e9b
	dir=`$echo "X$arg" | $Xsed -e 's/^-L//'`
Packit d36e9b
	# We need an absolute path.
Packit d36e9b
	case $dir in
Packit d36e9b
	[\\/]* | [A-Za-z]:[\\/]*) ;;
Packit d36e9b
	*)
Packit d36e9b
	  absdir=`cd "$dir" && pwd`
Packit d36e9b
	  if test -z "$absdir"; then
Packit d36e9b
	    $echo "$modename: cannot determine absolute directory name of \`$dir'" 1>&2
Packit d36e9b
	    absdir="$dir"
Packit d36e9b
	    notinst_path="$notinst_path $dir"
Packit d36e9b
	  fi
Packit d36e9b
	  dir="$absdir"
Packit d36e9b
	  ;;
Packit d36e9b
	esac
Packit d36e9b
	case "$deplibs " in
Packit d36e9b
	*" -L$dir "*) ;;
Packit d36e9b
	*)
Packit d36e9b
	  deplibs="$deplibs -L$dir"
Packit d36e9b
	  lib_search_path="$lib_search_path $dir"
Packit d36e9b
	  ;;
Packit d36e9b
	esac
Packit d36e9b
	case $host in
Packit d36e9b
	*-*-cygwin* | *-*-mingw* | *-*-pw32* | *-*-os2*)
Packit d36e9b
	  testbindir=`$echo "X$dir" | $Xsed -e 's*/lib$*/bin*'`
Packit d36e9b
	  case :$dllsearchpath: in
Packit d36e9b
	  *":$dir:"*) ;;
Packit d36e9b
	  *) dllsearchpath="$dllsearchpath:$dir";;
Packit d36e9b
	  esac
Packit d36e9b
	  case :$dllsearchpath: in
Packit d36e9b
	  *":$testbindir:"*) ;;
Packit d36e9b
	  *) dllsearchpath="$dllsearchpath:$testbindir";;
Packit d36e9b
	  esac
Packit d36e9b
	  ;;
Packit d36e9b
	esac
Packit d36e9b
	continue
Packit d36e9b
	;;
Packit d36e9b
Packit d36e9b
      -l*)
Packit d36e9b
	if test "X$arg" = "X-lc" || test "X$arg" = "X-lm"; then
Packit d36e9b
	  case $host in
Packit d36e9b
	  *-*-cygwin* | *-*-mingw* | *-*-pw32* | *-*-beos*)
Packit d36e9b
	    # These systems don't actually have a C or math library (as such)
Packit d36e9b
	    continue
Packit d36e9b
	    ;;
Packit d36e9b
	  *-*-os2*)
Packit d36e9b
	    # These systems don't actually have a C library (as such)
Packit d36e9b
	    test "X$arg" = "X-lc" && continue
Packit d36e9b
	    ;;
Packit d36e9b
	  *-*-openbsd* | *-*-freebsd* | *-*-dragonfly*)
Packit d36e9b
	    # Do not include libc due to us having libc/libc_r.
Packit d36e9b
	    test "X$arg" = "X-lc" && continue
Packit d36e9b
	    ;;
Packit d36e9b
	  *-*-rhapsody* | *-*-darwin1.[012])
Packit d36e9b
	    # Rhapsody C and math libraries are in the System framework
Packit d36e9b
	    deplibs="$deplibs -framework System"
Packit d36e9b
	    continue
Packit d36e9b
	    ;;
Packit d36e9b
	  *-*-sco3.2v5* | *-*-sco5v6*)
Packit d36e9b
	    # Causes problems with __ctype
Packit d36e9b
	    test "X$arg" = "X-lc" && continue
Packit d36e9b
	    ;;
Packit d36e9b
	  *-*-sysv4.2uw2* | *-*-sysv5* | *-*-unixware* | *-*-OpenUNIX*)
Packit d36e9b
	    # Compiler inserts libc in the correct place for threads to work
Packit d36e9b
	    test "X$arg" = "X-lc" && continue
Packit d36e9b
	    ;;
Packit d36e9b
	  esac
Packit d36e9b
	elif test "X$arg" = "X-lc_r"; then
Packit d36e9b
	 case $host in
Packit d36e9b
	 *-*-openbsd* | *-*-freebsd* | *-*-dragonfly*)
Packit d36e9b
	   # Do not include libc_r directly, use -pthread flag.
Packit d36e9b
	   continue
Packit d36e9b
	   ;;
Packit d36e9b
	 esac
Packit d36e9b
	fi
Packit d36e9b
	deplibs="$deplibs $arg"
Packit d36e9b
	continue
Packit d36e9b
	;;
Packit d36e9b
Packit d36e9b
      # Tru64 UNIX uses -model [arg] to determine the layout of C++
Packit d36e9b
      # classes, name mangling, and exception handling.
Packit d36e9b
      -model)
Packit d36e9b
	compile_command="$compile_command $arg"
Packit d36e9b
	compiler_flags="$compiler_flags $arg"
Packit d36e9b
	finalize_command="$finalize_command $arg"
Packit d36e9b
	prev=xcompiler
Packit d36e9b
	continue
Packit d36e9b
	;;
Packit d36e9b
Packit d36e9b
     -mt|-mthreads|-kthread|-Kthread|-pthread|-pthreads|--thread-safe)
Packit d36e9b
	compiler_flags="$compiler_flags $arg"
Packit d36e9b
	compile_command="$compile_command $arg"
Packit d36e9b
	finalize_command="$finalize_command $arg"
Packit d36e9b
	continue
Packit d36e9b
	;;
Packit d36e9b
Packit d36e9b
      -module)
Packit d36e9b
	module=yes
Packit d36e9b
	continue
Packit d36e9b
	;;
Packit d36e9b
Packit d36e9b
      # -64, -mips[0-9] enable 64-bit mode on the SGI compiler
Packit d36e9b
      # -r[0-9][0-9]* specifies the processor on the SGI compiler
Packit d36e9b
      # -xarch=*, -xtarget=* enable 64-bit mode on the Sun compiler
Packit d36e9b
      # +DA*, +DD* enable 64-bit mode on the HP compiler
Packit d36e9b
      # -q* pass through compiler args for the IBM compiler
Packit d36e9b
      # -m* pass through architecture-specific compiler args for GCC
Packit d36e9b
      # -m*, -t[45]*, -txscale* pass through architecture-specific
Packit d36e9b
      # compiler args for GCC
Packit d36e9b
      # -pg pass through profiling flag for GCC
Packit d36e9b
      # @file GCC response files
Packit d36e9b
      -64|-mips[0-9]|-r[0-9][0-9]*|-xarch=*|-xtarget=*|+DA*|+DD*|-q*|-m*|-pg| \
Packit d36e9b
      -t[45]*|-txscale*|@*)
Packit d36e9b
Packit d36e9b
	# Unknown arguments in both finalize_command and compile_command need
Packit d36e9b
	# to be aesthetically quoted because they are evaled later.
Packit d36e9b
	arg=`$echo "X$arg" | $Xsed -e "$sed_quote_subst"`
Packit d36e9b
	case $arg in
Packit d36e9b
	*[\[\~\#\^\&\*\(\)\{\}\|\;\<\>\?\'\ \	]*|*]*|"")
Packit d36e9b
	  arg="\"$arg\""
Packit d36e9b
	  ;;
Packit d36e9b
	esac
Packit d36e9b
        compile_command="$compile_command $arg"
Packit d36e9b
        finalize_command="$finalize_command $arg"
Packit d36e9b
        compiler_flags="$compiler_flags $arg"
Packit d36e9b
        continue
Packit d36e9b
        ;;
Packit d36e9b
Packit d36e9b
      -shrext)
Packit d36e9b
	prev=shrext
Packit d36e9b
	continue
Packit d36e9b
	;;
Packit d36e9b
Packit d36e9b
      -no-fast-install)
Packit d36e9b
	fast_install=no
Packit d36e9b
	continue
Packit d36e9b
	;;
Packit d36e9b
Packit d36e9b
      -no-install)
Packit d36e9b
	case $host in
Packit d36e9b
	*-*-cygwin* | *-*-mingw* | *-*-pw32* | *-*-os2*)
Packit d36e9b
	  # The PATH hackery in wrapper scripts is required on Windows
Packit d36e9b
	  # in order for the loader to find any dlls it needs.
Packit d36e9b
	  $echo "$modename: warning: \`-no-install' is ignored for $host" 1>&2
Packit d36e9b
	  $echo "$modename: warning: assuming \`-no-fast-install' instead" 1>&2
Packit d36e9b
	  fast_install=no
Packit d36e9b
	  ;;
Packit d36e9b
	*) no_install=yes ;;
Packit d36e9b
	esac
Packit d36e9b
	continue
Packit d36e9b
	;;
Packit d36e9b
Packit d36e9b
      -no-undefined)
Packit d36e9b
	allow_undefined=no
Packit d36e9b
	continue
Packit d36e9b
	;;
Packit d36e9b
Packit d36e9b
      -objectlist)
Packit d36e9b
	prev=objectlist
Packit d36e9b
	continue
Packit d36e9b
	;;
Packit d36e9b
Packit d36e9b
      -o) prev=output ;;
Packit d36e9b
Packit d36e9b
      -precious-files-regex)
Packit d36e9b
	prev=precious_regex
Packit d36e9b
	continue
Packit d36e9b
	;;
Packit d36e9b
Packit d36e9b
      -release)
Packit d36e9b
	prev=release
Packit d36e9b
	continue
Packit d36e9b
	;;
Packit d36e9b
Packit d36e9b
      -rpath)
Packit d36e9b
	prev=rpath
Packit d36e9b
	continue
Packit d36e9b
	;;
Packit d36e9b
Packit d36e9b
      -R)
Packit d36e9b
	prev=xrpath
Packit d36e9b
	continue
Packit d36e9b
	;;
Packit d36e9b
Packit d36e9b
      -R*)
Packit d36e9b
	dir=`$echo "X$arg" | $Xsed -e 's/^-R//'`
Packit d36e9b
	# We need an absolute path.
Packit d36e9b
	case $dir in
Packit d36e9b
	[\\/]* | [A-Za-z]:[\\/]*) ;;
Packit d36e9b
	*)
Packit d36e9b
	  $echo "$modename: only absolute run-paths are allowed" 1>&2
Packit d36e9b
	  exit $EXIT_FAILURE
Packit d36e9b
	  ;;
Packit d36e9b
	esac
Packit d36e9b
	case "$xrpath " in
Packit d36e9b
	*" $dir "*) ;;
Packit d36e9b
	*) xrpath="$xrpath $dir" ;;
Packit d36e9b
	esac
Packit d36e9b
	continue
Packit d36e9b
	;;
Packit d36e9b
Packit d36e9b
      -static | -static-libtool-libs)
Packit d36e9b
	# The effects of -static are defined in a previous loop.
Packit d36e9b
	# We used to do the same as -all-static on platforms that
Packit d36e9b
	# didn't have a PIC flag, but the assumption that the effects
Packit d36e9b
	# would be equivalent was wrong.  It would break on at least
Packit d36e9b
	# Digital Unix and AIX.
Packit d36e9b
	continue
Packit d36e9b
	;;
Packit d36e9b
Packit d36e9b
      -thread-safe)
Packit d36e9b
	thread_safe=yes
Packit d36e9b
	continue
Packit d36e9b
	;;
Packit d36e9b
Packit d36e9b
      -version-info)
Packit d36e9b
	prev=vinfo
Packit d36e9b
	continue
Packit d36e9b
	;;
Packit d36e9b
      -version-number)
Packit d36e9b
	prev=vinfo
Packit d36e9b
	vinfo_number=yes
Packit d36e9b
	continue
Packit d36e9b
	;;
Packit d36e9b
Packit d36e9b
      -Wc,*)
Packit d36e9b
	args=`$echo "X$arg" | $Xsed -e "$sed_quote_subst" -e 's/^-Wc,//'`
Packit d36e9b
	arg=
Packit d36e9b
	save_ifs="$IFS"; IFS=','
Packit d36e9b
	for flag in $args; do
Packit d36e9b
	  IFS="$save_ifs"
Packit d36e9b
	  case $flag in
Packit d36e9b
	    *[\[\~\#\^\&\*\(\)\{\}\|\;\<\>\?\'\ \	]*|*]*|"")
Packit d36e9b
	    flag="\"$flag\""
Packit d36e9b
	    ;;
Packit d36e9b
	  esac
Packit d36e9b
	  arg="$arg $wl$flag"
Packit d36e9b
	  compiler_flags="$compiler_flags $flag"
Packit d36e9b
	done
Packit d36e9b
	IFS="$save_ifs"
Packit d36e9b
	arg=`$echo "X$arg" | $Xsed -e "s/^ //"`
Packit d36e9b
	;;
Packit d36e9b
Packit d36e9b
      -Wl,*)
Packit d36e9b
	args=`$echo "X$arg" | $Xsed -e "$sed_quote_subst" -e 's/^-Wl,//'`
Packit d36e9b
	arg=
Packit d36e9b
	save_ifs="$IFS"; IFS=','
Packit d36e9b
	for flag in $args; do
Packit d36e9b
	  IFS="$save_ifs"
Packit d36e9b
	  case $flag in
Packit d36e9b
	    *[\[\~\#\^\&\*\(\)\{\}\|\;\<\>\?\'\ \	]*|*]*|"")
Packit d36e9b
	    flag="\"$flag\""
Packit d36e9b
	    ;;
Packit d36e9b
	  esac
Packit d36e9b
	  arg="$arg $wl$flag"
Packit d36e9b
	  compiler_flags="$compiler_flags $wl$flag"
Packit d36e9b
	  linker_flags="$linker_flags $flag"
Packit d36e9b
	done
Packit d36e9b
	IFS="$save_ifs"
Packit d36e9b
	arg=`$echo "X$arg" | $Xsed -e "s/^ //"`
Packit d36e9b
	;;
Packit d36e9b
Packit d36e9b
      -Xcompiler)
Packit d36e9b
	prev=xcompiler
Packit d36e9b
	continue
Packit d36e9b
	;;
Packit d36e9b
Packit d36e9b
      -Xlinker)
Packit d36e9b
	prev=xlinker
Packit d36e9b
	continue
Packit d36e9b
	;;
Packit d36e9b
Packit d36e9b
      -XCClinker)
Packit d36e9b
	prev=xcclinker
Packit d36e9b
	continue
Packit d36e9b
	;;
Packit d36e9b
Packit d36e9b
      # Some other compiler flag.
Packit d36e9b
      -* | +*)
Packit d36e9b
	# Unknown arguments in both finalize_command and compile_command need
Packit d36e9b
	# to be aesthetically quoted because they are evaled later.
Packit d36e9b
	arg=`$echo "X$arg" | $Xsed -e "$sed_quote_subst"`
Packit d36e9b
	case $arg in
Packit d36e9b
	*[\[\~\#\^\&\*\(\)\{\}\|\;\<\>\?\'\ \	]*|*]*|"")
Packit d36e9b
	  arg="\"$arg\""
Packit d36e9b
	  ;;
Packit d36e9b
	esac
Packit d36e9b
	;;
Packit d36e9b
Packit d36e9b
      *.$objext)
Packit d36e9b
	# A standard object.
Packit d36e9b
	objs="$objs $arg"
Packit d36e9b
	;;
Packit d36e9b
Packit d36e9b
      *.lo)
Packit d36e9b
	# A libtool-controlled object.
Packit d36e9b
Packit d36e9b
	# Check to see that this really is a libtool object.
Packit d36e9b
	if (${SED} -e '2q' $arg | grep "^# Generated by .*$PACKAGE") >/dev/null 2>&1; then
Packit d36e9b
	  pic_object=
Packit d36e9b
	  non_pic_object=
Packit d36e9b
Packit d36e9b
	  # Read the .lo file
Packit d36e9b
	  # If there is no directory component, then add one.
Packit d36e9b
	  case $arg in
Packit d36e9b
	  */* | *\\*) . $arg ;;
Packit d36e9b
	  *) . ./$arg ;;
Packit d36e9b
	  esac
Packit d36e9b
Packit d36e9b
	  if test -z "$pic_object" || \
Packit d36e9b
	     test -z "$non_pic_object" ||
Packit d36e9b
	     test "$pic_object" = none && \
Packit d36e9b
	     test "$non_pic_object" = none; then
Packit d36e9b
	    $echo "$modename: cannot find name of object for \`$arg'" 1>&2
Packit d36e9b
	    exit $EXIT_FAILURE
Packit d36e9b
	  fi
Packit d36e9b
Packit d36e9b
	  # Extract subdirectory from the argument.
Packit d36e9b
	  xdir=`$echo "X$arg" | $Xsed -e 's%/[^/]*$%%'`
Packit d36e9b
	  if test "X$xdir" = "X$arg"; then
Packit d36e9b
	    xdir=
Packit d36e9b
 	  else
Packit d36e9b
	    xdir="$xdir/"
Packit d36e9b
	  fi
Packit d36e9b
Packit d36e9b
	  if test "$pic_object" != none; then
Packit d36e9b
	    # Prepend the subdirectory the object is found in.
Packit d36e9b
	    pic_object="$xdir$pic_object"
Packit d36e9b
Packit d36e9b
	    if test "$prev" = dlfiles; then
Packit d36e9b
	      if test "$build_libtool_libs" = yes && test "$dlopen_support" = yes; then
Packit d36e9b
		dlfiles="$dlfiles $pic_object"
Packit d36e9b
		prev=
Packit d36e9b
		continue
Packit d36e9b
	      else
Packit d36e9b
		# If libtool objects are unsupported, then we need to preload.
Packit d36e9b
		prev=dlprefiles
Packit d36e9b
	      fi
Packit d36e9b
	    fi
Packit d36e9b
Packit d36e9b
	    # CHECK ME:  I think I busted this.  -Ossama
Packit d36e9b
	    if test "$prev" = dlprefiles; then
Packit d36e9b
	      # Preload the old-style object.
Packit d36e9b
	      dlprefiles="$dlprefiles $pic_object"
Packit d36e9b
	      prev=
Packit d36e9b
	    fi
Packit d36e9b
Packit d36e9b
	    # A PIC object.
Packit d36e9b
	    libobjs="$libobjs $pic_object"
Packit d36e9b
	    arg="$pic_object"
Packit d36e9b
	  fi
Packit d36e9b
Packit d36e9b
	  # Non-PIC object.
Packit d36e9b
	  if test "$non_pic_object" != none; then
Packit d36e9b
	    # Prepend the subdirectory the object is found in.
Packit d36e9b
	    non_pic_object="$xdir$non_pic_object"
Packit d36e9b
Packit d36e9b
	    # A standard non-PIC object
Packit d36e9b
	    non_pic_objects="$non_pic_objects $non_pic_object"
Packit d36e9b
	    if test -z "$pic_object" || test "$pic_object" = none ; then
Packit d36e9b
	      arg="$non_pic_object"
Packit d36e9b
	    fi
Packit d36e9b
	  else
Packit d36e9b
	    # If the PIC object exists, use it instead.
Packit d36e9b
	    # $xdir was prepended to $pic_object above.
Packit d36e9b
	    non_pic_object="$pic_object"
Packit d36e9b
	    non_pic_objects="$non_pic_objects $non_pic_object"
Packit d36e9b
	  fi
Packit d36e9b
	else
Packit d36e9b
	  # Only an error if not doing a dry-run.
Packit d36e9b
	  if test -z "$run"; then
Packit d36e9b
	    $echo "$modename: \`$arg' is not a valid libtool object" 1>&2
Packit d36e9b
	    exit $EXIT_FAILURE
Packit d36e9b
	  else
Packit d36e9b
	    # Dry-run case.
Packit d36e9b
Packit d36e9b
	    # Extract subdirectory from the argument.
Packit d36e9b
	    xdir=`$echo "X$arg" | $Xsed -e 's%/[^/]*$%%'`
Packit d36e9b
	    if test "X$xdir" = "X$arg"; then
Packit d36e9b
	      xdir=
Packit d36e9b
	    else
Packit d36e9b
	      xdir="$xdir/"
Packit d36e9b
	    fi
Packit d36e9b
Packit d36e9b
	    pic_object=`$echo "X${xdir}${objdir}/${arg}" | $Xsed -e "$lo2o"`
Packit d36e9b
	    non_pic_object=`$echo "X${xdir}${arg}" | $Xsed -e "$lo2o"`
Packit d36e9b
	    libobjs="$libobjs $pic_object"
Packit d36e9b
	    non_pic_objects="$non_pic_objects $non_pic_object"
Packit d36e9b
	  fi
Packit d36e9b
	fi
Packit d36e9b
	;;
Packit d36e9b
Packit d36e9b
      *.$libext)
Packit d36e9b
	# An archive.
Packit d36e9b
	deplibs="$deplibs $arg"
Packit d36e9b
	old_deplibs="$old_deplibs $arg"
Packit d36e9b
	continue
Packit d36e9b
	;;
Packit d36e9b
Packit d36e9b
      *.la)
Packit d36e9b
	# A libtool-controlled library.
Packit d36e9b
Packit d36e9b
	if test "$prev" = dlfiles; then
Packit d36e9b
	  # This library was specified with -dlopen.
Packit d36e9b
	  dlfiles="$dlfiles $arg"
Packit d36e9b
	  prev=
Packit d36e9b
	elif test "$prev" = dlprefiles; then
Packit d36e9b
	  # The library was specified with -dlpreopen.
Packit d36e9b
	  dlprefiles="$dlprefiles $arg"
Packit d36e9b
	  prev=
Packit d36e9b
	else
Packit d36e9b
	  deplibs="$deplibs $arg"
Packit d36e9b
	fi
Packit d36e9b
	continue
Packit d36e9b
	;;
Packit d36e9b
Packit d36e9b
      # Some other compiler argument.
Packit d36e9b
      *)
Packit d36e9b
	# Unknown arguments in both finalize_command and compile_command need
Packit d36e9b
	# to be aesthetically quoted because they are evaled later.
Packit d36e9b
	arg=`$echo "X$arg" | $Xsed -e "$sed_quote_subst"`
Packit d36e9b
	case $arg in
Packit d36e9b
	*[\[\~\#\^\&\*\(\)\{\}\|\;\<\>\?\'\ \	]*|*]*|"")
Packit d36e9b
	  arg="\"$arg\""
Packit d36e9b
	  ;;
Packit d36e9b
	esac
Packit d36e9b
	;;
Packit d36e9b
      esac # arg
Packit d36e9b
Packit d36e9b
      # Now actually substitute the argument into the commands.
Packit d36e9b
      if test -n "$arg"; then
Packit d36e9b
	compile_command="$compile_command $arg"
Packit d36e9b
	finalize_command="$finalize_command $arg"
Packit d36e9b
      fi
Packit d36e9b
    done # argument parsing loop
Packit d36e9b
Packit d36e9b
    if test -n "$prev"; then
Packit d36e9b
      $echo "$modename: the \`$prevarg' option requires an argument" 1>&2
Packit d36e9b
      $echo "$help" 1>&2
Packit d36e9b
      exit $EXIT_FAILURE
Packit d36e9b
    fi
Packit d36e9b
Packit d36e9b
    if test "$export_dynamic" = yes && test -n "$export_dynamic_flag_spec"; then
Packit d36e9b
      eval arg=\"$export_dynamic_flag_spec\"
Packit d36e9b
      compile_command="$compile_command $arg"
Packit d36e9b
      finalize_command="$finalize_command $arg"
Packit d36e9b
    fi
Packit d36e9b
Packit d36e9b
    oldlibs=
Packit d36e9b
    # calculate the name of the file, without its directory
Packit d36e9b
    outputname=`$echo "X$output" | $Xsed -e 's%^.*/%%'`
Packit d36e9b
    libobjs_save="$libobjs"
Packit d36e9b
Packit d36e9b
    if test -n "$shlibpath_var"; then
Packit d36e9b
      # get the directories listed in $shlibpath_var
Packit d36e9b
      eval shlib_search_path=\`\$echo \"X\${$shlibpath_var}\" \| \$Xsed -e \'s/:/ /g\'\`
Packit d36e9b
    else
Packit d36e9b
      shlib_search_path=
Packit d36e9b
    fi
Packit d36e9b
    eval sys_lib_search_path=\"$sys_lib_search_path_spec\"
Packit d36e9b
    eval sys_lib_dlsearch_path=\"$sys_lib_dlsearch_path_spec\"
Packit d36e9b
Packit d36e9b
    output_objdir=`$echo "X$output" | $Xsed -e 's%/[^/]*$%%'`
Packit d36e9b
    if test "X$output_objdir" = "X$output"; then
Packit d36e9b
      output_objdir="$objdir"
Packit d36e9b
    else
Packit d36e9b
      output_objdir="$output_objdir/$objdir"
Packit d36e9b
    fi
Packit d36e9b
    # Create the object directory.
Packit d36e9b
    if test ! -d "$output_objdir"; then
Packit d36e9b
      $show "$mkdir $output_objdir"
Packit d36e9b
      $run $mkdir $output_objdir
Packit d36e9b
      exit_status=$?
Packit d36e9b
      if test "$exit_status" -ne 0 && test ! -d "$output_objdir"; then
Packit d36e9b
	exit $exit_status
Packit d36e9b
      fi
Packit d36e9b
    fi
Packit d36e9b
Packit d36e9b
    # Determine the type of output
Packit d36e9b
    case $output in
Packit d36e9b
    "")
Packit d36e9b
      $echo "$modename: you must specify an output file" 1>&2
Packit d36e9b
      $echo "$help" 1>&2
Packit d36e9b
      exit $EXIT_FAILURE
Packit d36e9b
      ;;
Packit d36e9b
    *.$libext) linkmode=oldlib ;;
Packit d36e9b
    *.lo | *.$objext) linkmode=obj ;;
Packit d36e9b
    *.la) linkmode=lib ;;
Packit d36e9b
    *) linkmode=prog ;; # Anything else should be a program.
Packit d36e9b
    esac
Packit d36e9b
Packit d36e9b
    case $host in
Packit d36e9b
    *cygwin* | *mingw* | *pw32*)
Packit d36e9b
      # don't eliminate duplications in $postdeps and $predeps
Packit d36e9b
      duplicate_compiler_generated_deps=yes
Packit d36e9b
      ;;
Packit d36e9b
    *)
Packit d36e9b
      duplicate_compiler_generated_deps=$duplicate_deps
Packit d36e9b
      ;;
Packit d36e9b
    esac
Packit d36e9b
    specialdeplibs=
Packit d36e9b
Packit d36e9b
    libs=
Packit d36e9b
    # Find all interdependent deplibs by searching for libraries
Packit d36e9b
    # that are linked more than once (e.g. -la -lb -la)
Packit d36e9b
    for deplib in $deplibs; do
Packit d36e9b
      if test "X$duplicate_deps" = "Xyes" ; then
Packit d36e9b
	case "$libs " in
Packit d36e9b
	*" $deplib "*) specialdeplibs="$specialdeplibs $deplib" ;;
Packit d36e9b
	esac
Packit d36e9b
      fi
Packit d36e9b
      libs="$libs $deplib"
Packit d36e9b
    done
Packit d36e9b
Packit d36e9b
    if test "$linkmode" = lib; then
Packit d36e9b
      libs="$predeps $libs $compiler_lib_search_path $postdeps"
Packit d36e9b
Packit d36e9b
      # Compute libraries that are listed more than once in $predeps
Packit d36e9b
      # $postdeps and mark them as special (i.e., whose duplicates are
Packit d36e9b
      # not to be eliminated).
Packit d36e9b
      pre_post_deps=
Packit d36e9b
      if test "X$duplicate_compiler_generated_deps" = "Xyes" ; then
Packit d36e9b
	for pre_post_dep in $predeps $postdeps; do
Packit d36e9b
	  case "$pre_post_deps " in
Packit d36e9b
	  *" $pre_post_dep "*) specialdeplibs="$specialdeplibs $pre_post_deps" ;;
Packit d36e9b
	  esac
Packit d36e9b
	  pre_post_deps="$pre_post_deps $pre_post_dep"
Packit d36e9b
	done
Packit d36e9b
      fi
Packit d36e9b
      pre_post_deps=
Packit d36e9b
    fi
Packit d36e9b
Packit d36e9b
    deplibs=
Packit d36e9b
    newdependency_libs=
Packit d36e9b
    newlib_search_path=
Packit d36e9b
    need_relink=no # whether we're linking any uninstalled libtool libraries
Packit d36e9b
    notinst_deplibs= # not-installed libtool libraries
Packit d36e9b
    case $linkmode in
Packit d36e9b
    lib)
Packit d36e9b
	passes="conv link"
Packit d36e9b
	for file in $dlfiles $dlprefiles; do
Packit d36e9b
	  case $file in
Packit d36e9b
	  *.la) ;;
Packit d36e9b
	  *)
Packit d36e9b
	    $echo "$modename: libraries can \`-dlopen' only libtool libraries: $file" 1>&2
Packit d36e9b
	    exit $EXIT_FAILURE
Packit d36e9b
	    ;;
Packit d36e9b
	  esac
Packit d36e9b
	done
Packit d36e9b
	;;
Packit d36e9b
    prog)
Packit d36e9b
	compile_deplibs=
Packit d36e9b
	finalize_deplibs=
Packit d36e9b
	alldeplibs=no
Packit d36e9b
	newdlfiles=
Packit d36e9b
	newdlprefiles=
Packit d36e9b
	passes="conv scan dlopen dlpreopen link"
Packit d36e9b
	;;
Packit d36e9b
    *)  passes="conv"
Packit d36e9b
	;;
Packit d36e9b
    esac
Packit d36e9b
    for pass in $passes; do
Packit d36e9b
      if test "$linkmode,$pass" = "lib,link" ||
Packit d36e9b
	 test "$linkmode,$pass" = "prog,scan"; then
Packit d36e9b
	libs="$deplibs"
Packit d36e9b
	deplibs=
Packit d36e9b
      fi
Packit d36e9b
      if test "$linkmode" = prog; then
Packit d36e9b
	case $pass in
Packit d36e9b
	dlopen) libs="$dlfiles" ;;
Packit d36e9b
	dlpreopen) libs="$dlprefiles" ;;
Packit d36e9b
	link) libs="$deplibs %DEPLIBS% $dependency_libs" ;;
Packit d36e9b
	esac
Packit d36e9b
      fi
Packit d36e9b
      if test "$pass" = dlopen; then
Packit d36e9b
	# Collect dlpreopened libraries
Packit d36e9b
	save_deplibs="$deplibs"
Packit d36e9b
	deplibs=
Packit d36e9b
      fi
Packit d36e9b
      for deplib in $libs; do
Packit d36e9b
	lib=
Packit d36e9b
	found=no
Packit d36e9b
	case $deplib in
Packit d36e9b
	-mt|-mthreads|-kthread|-Kthread|-pthread|-pthreads|--thread-safe)
Packit d36e9b
	  if test "$linkmode,$pass" = "prog,link"; then
Packit d36e9b
	    compile_deplibs="$deplib $compile_deplibs"
Packit d36e9b
	    finalize_deplibs="$deplib $finalize_deplibs"
Packit d36e9b
	  else
Packit d36e9b
	    compiler_flags="$compiler_flags $deplib"
Packit d36e9b
	  fi
Packit d36e9b
	  continue
Packit d36e9b
	  ;;
Packit d36e9b
	-l*)
Packit d36e9b
	  if test "$linkmode" != lib && test "$linkmode" != prog; then
Packit d36e9b
	    $echo "$modename: warning: \`-l' is ignored for archives/objects" 1>&2
Packit d36e9b
	    continue
Packit d36e9b
	  fi
Packit d36e9b
	  name=`$echo "X$deplib" | $Xsed -e 's/^-l//'`
Packit d36e9b
	  for searchdir in $newlib_search_path $lib_search_path $sys_lib_search_path $shlib_search_path; do
Packit d36e9b
	    for search_ext in .la $std_shrext .so .a; do
Packit d36e9b
	      # Search the libtool library
Packit d36e9b
	      lib="$searchdir/lib${name}${search_ext}"
Packit d36e9b
	      if test -f "$lib"; then
Packit d36e9b
		if test "$search_ext" = ".la"; then
Packit d36e9b
		  found=yes
Packit d36e9b
		else
Packit d36e9b
		  found=no
Packit d36e9b
		fi
Packit d36e9b
		break 2
Packit d36e9b
	      fi
Packit d36e9b
	    done
Packit d36e9b
	  done
Packit d36e9b
	  if test "$found" != yes; then
Packit d36e9b
	    # deplib doesn't seem to be a libtool library
Packit d36e9b
	    if test "$linkmode,$pass" = "prog,link"; then
Packit d36e9b
	      compile_deplibs="$deplib $compile_deplibs"
Packit d36e9b
	      finalize_deplibs="$deplib $finalize_deplibs"
Packit d36e9b
	    else
Packit d36e9b
	      deplibs="$deplib $deplibs"
Packit d36e9b
	      test "$linkmode" = lib && newdependency_libs="$deplib $newdependency_libs"
Packit d36e9b
	    fi
Packit d36e9b
	    continue
Packit d36e9b
	  else # deplib is a libtool library
Packit d36e9b
	    # If $allow_libtool_libs_with_static_runtimes && $deplib is a stdlib,
Packit d36e9b
	    # We need to do some special things here, and not later.
Packit d36e9b
	    if test "X$allow_libtool_libs_with_static_runtimes" = "Xyes" ; then
Packit d36e9b
	      case " $predeps $postdeps " in
Packit d36e9b
	      *" $deplib "*)
Packit d36e9b
		if (${SED} -e '2q' $lib |
Packit d36e9b
                    grep "^# Generated by .*$PACKAGE") >/dev/null 2>&1; then
Packit d36e9b
		  library_names=
Packit d36e9b
		  old_library=
Packit d36e9b
		  case $lib in
Packit d36e9b
		  */* | *\\*) . $lib ;;
Packit d36e9b
		  *) . ./$lib ;;
Packit d36e9b
		  esac
Packit d36e9b
		  for l in $old_library $library_names; do
Packit d36e9b
		    ll="$l"
Packit d36e9b
		  done
Packit d36e9b
		  if test "X$ll" = "X$old_library" ; then # only static version available
Packit d36e9b
		    found=no
Packit d36e9b
		    ladir=`$echo "X$lib" | $Xsed -e 's%/[^/]*$%%'`
Packit d36e9b
		    test "X$ladir" = "X$lib" && ladir="."
Packit d36e9b
		    lib=$ladir/$old_library
Packit d36e9b
		    if test "$linkmode,$pass" = "prog,link"; then
Packit d36e9b
		      compile_deplibs="$deplib $compile_deplibs"
Packit d36e9b
		      finalize_deplibs="$deplib $finalize_deplibs"
Packit d36e9b
		    else
Packit d36e9b
		      deplibs="$deplib $deplibs"
Packit d36e9b
		      test "$linkmode" = lib && newdependency_libs="$deplib $newdependency_libs"
Packit d36e9b
		    fi
Packit d36e9b
		    continue
Packit d36e9b
		  fi
Packit d36e9b
		fi
Packit d36e9b
	        ;;
Packit d36e9b
	      *) ;;
Packit d36e9b
	      esac
Packit d36e9b
	    fi
Packit d36e9b
	  fi
Packit d36e9b
	  ;; # -l
Packit d36e9b
	-L*)
Packit d36e9b
	  case $linkmode in
Packit d36e9b
	  lib)
Packit d36e9b
	    deplibs="$deplib $deplibs"
Packit d36e9b
	    test "$pass" = conv && continue
Packit d36e9b
	    newdependency_libs="$deplib $newdependency_libs"
Packit d36e9b
	    newlib_search_path="$newlib_search_path "`$echo "X$deplib" | $Xsed -e 's/^-L//'`
Packit d36e9b
	    ;;
Packit d36e9b
	  prog)
Packit d36e9b
	    if test "$pass" = conv; then
Packit d36e9b
	      deplibs="$deplib $deplibs"
Packit d36e9b
	      continue
Packit d36e9b
	    fi
Packit d36e9b
	    if test "$pass" = scan; then
Packit d36e9b
	      deplibs="$deplib $deplibs"
Packit d36e9b
	    else
Packit d36e9b
	      compile_deplibs="$deplib $compile_deplibs"
Packit d36e9b
	      finalize_deplibs="$deplib $finalize_deplibs"
Packit d36e9b
	    fi
Packit d36e9b
	    newlib_search_path="$newlib_search_path "`$echo "X$deplib" | $Xsed -e 's/^-L//'`
Packit d36e9b
	    ;;
Packit d36e9b
	  *)
Packit d36e9b
	    $echo "$modename: warning: \`-L' is ignored for archives/objects" 1>&2
Packit d36e9b
	    ;;
Packit d36e9b
	  esac # linkmode
Packit d36e9b
	  continue
Packit d36e9b
	  ;; # -L
Packit d36e9b
	-R*)
Packit d36e9b
	  if test "$pass" = link; then
Packit d36e9b
	    dir=`$echo "X$deplib" | $Xsed -e 's/^-R//'`
Packit d36e9b
	    # Make sure the xrpath contains only unique directories.
Packit d36e9b
	    case "$xrpath " in
Packit d36e9b
	    *" $dir "*) ;;
Packit d36e9b
	    *) xrpath="$xrpath $dir" ;;
Packit d36e9b
	    esac
Packit d36e9b
	  fi
Packit d36e9b
	  deplibs="$deplib $deplibs"
Packit d36e9b
	  continue
Packit d36e9b
	  ;;
Packit d36e9b
	*.la) lib="$deplib" ;;
Packit d36e9b
	*.$libext)
Packit d36e9b
	  if test "$pass" = conv; then
Packit d36e9b
	    deplibs="$deplib $deplibs"
Packit d36e9b
	    continue
Packit d36e9b
	  fi
Packit d36e9b
	  case $linkmode in
Packit d36e9b
	  lib)
Packit d36e9b
	    valid_a_lib=no
Packit d36e9b
	    case $deplibs_check_method in
Packit d36e9b
	      match_pattern*)
Packit d36e9b
		set dummy $deplibs_check_method
Packit d36e9b
	        match_pattern_regex=`expr "$deplibs_check_method" : "$2 \(.*\)"`
Packit d36e9b
		if eval $echo \"$deplib\" 2>/dev/null \
Packit d36e9b
		    | $SED 10q \
Packit d36e9b
		    | $EGREP "$match_pattern_regex" > /dev/null; then
Packit d36e9b
		  valid_a_lib=yes
Packit d36e9b
		fi
Packit d36e9b
		;;
Packit d36e9b
	      pass_all)
Packit d36e9b
		valid_a_lib=yes
Packit d36e9b
		;;
Packit d36e9b
            esac
Packit d36e9b
	    if test "$valid_a_lib" != yes; then
Packit d36e9b
	      $echo
Packit d36e9b
	      $echo "*** Warning: Trying to link with static lib archive $deplib."
Packit d36e9b
	      $echo "*** I have the capability to make that library automatically link in when"
Packit d36e9b
	      $echo "*** you link to this library.  But I can only do this if you have a"
Packit d36e9b
	      $echo "*** shared version of the library, which you do not appear to have"
Packit d36e9b
	      $echo "*** because the file extensions .$libext of this argument makes me believe"
Packit d36e9b
	      $echo "*** that it is just a static archive that I should not used here."
Packit d36e9b
	    else
Packit d36e9b
	      $echo
Packit d36e9b
	      $echo "*** Warning: Linking the shared library $output against the"
Packit d36e9b
	      $echo "*** static library $deplib is not portable!"
Packit d36e9b
	      deplibs="$deplib $deplibs"
Packit d36e9b
	    fi
Packit d36e9b
	    continue
Packit d36e9b
	    ;;
Packit d36e9b
	  prog)
Packit d36e9b
	    if test "$pass" != link; then
Packit d36e9b
	      deplibs="$deplib $deplibs"
Packit d36e9b
	    else
Packit d36e9b
	      compile_deplibs="$deplib $compile_deplibs"
Packit d36e9b
	      finalize_deplibs="$deplib $finalize_deplibs"
Packit d36e9b
	    fi
Packit d36e9b
	    continue
Packit d36e9b
	    ;;
Packit d36e9b
	  esac # linkmode
Packit d36e9b
	  ;; # *.$libext
Packit d36e9b
	*.lo | *.$objext)
Packit d36e9b
	  if test "$pass" = conv; then
Packit d36e9b
	    deplibs="$deplib $deplibs"
Packit d36e9b
	  elif test "$linkmode" = prog; then
Packit d36e9b
	    if test "$pass" = dlpreopen || test "$dlopen_support" != yes || test "$build_libtool_libs" = no; then
Packit d36e9b
	      # If there is no dlopen support or we're linking statically,
Packit d36e9b
	      # we need to preload.
Packit d36e9b
	      newdlprefiles="$newdlprefiles $deplib"
Packit d36e9b
	      compile_deplibs="$deplib $compile_deplibs"
Packit d36e9b
	      finalize_deplibs="$deplib $finalize_deplibs"
Packit d36e9b
	    else
Packit d36e9b
	      newdlfiles="$newdlfiles $deplib"
Packit d36e9b
	    fi
Packit d36e9b
	  fi
Packit d36e9b
	  continue
Packit d36e9b
	  ;;
Packit d36e9b
	%DEPLIBS%)
Packit d36e9b
	  alldeplibs=yes
Packit d36e9b
	  continue
Packit d36e9b
	  ;;
Packit d36e9b
	esac # case $deplib
Packit d36e9b
	if test "$found" = yes || test -f "$lib"; then :
Packit d36e9b
	else
Packit d36e9b
	  $echo "$modename: cannot find the library \`$lib' or unhandled argument \`$deplib'" 1>&2
Packit d36e9b
	  exit $EXIT_FAILURE
Packit d36e9b
	fi
Packit d36e9b
Packit d36e9b
	# Check to see that this really is a libtool archive.
Packit d36e9b
	if (${SED} -e '2q' $lib | grep "^# Generated by .*$PACKAGE") >/dev/null 2>&1; then :
Packit d36e9b
	else
Packit d36e9b
	  $echo "$modename: \`$lib' is not a valid libtool archive" 1>&2
Packit d36e9b
	  exit $EXIT_FAILURE
Packit d36e9b
	fi
Packit d36e9b
Packit d36e9b
	ladir=`$echo "X$lib" | $Xsed -e 's%/[^/]*$%%'`
Packit d36e9b
	test "X$ladir" = "X$lib" && ladir="."
Packit d36e9b
Packit d36e9b
	dlname=
Packit d36e9b
	dlopen=
Packit d36e9b
	dlpreopen=
Packit d36e9b
	libdir=
Packit d36e9b
	library_names=
Packit d36e9b
	old_library=
Packit d36e9b
	# If the library was installed with an old release of libtool,
Packit d36e9b
	# it will not redefine variables installed, or shouldnotlink
Packit d36e9b
	installed=yes
Packit d36e9b
	shouldnotlink=no
Packit d36e9b
	avoidtemprpath=
Packit d36e9b
Packit d36e9b
Packit d36e9b
	# Read the .la file
Packit d36e9b
	case $lib in
Packit d36e9b
	*/* | *\\*) . $lib ;;
Packit d36e9b
	*) . ./$lib ;;
Packit d36e9b
	esac
Packit d36e9b
Packit d36e9b
	if test "$linkmode,$pass" = "lib,link" ||
Packit d36e9b
	   test "$linkmode,$pass" = "prog,scan" ||
Packit d36e9b
	   { test "$linkmode" != prog && test "$linkmode" != lib; }; then
Packit d36e9b
	  test -n "$dlopen" && dlfiles="$dlfiles $dlopen"
Packit d36e9b
	  test -n "$dlpreopen" && dlprefiles="$dlprefiles $dlpreopen"
Packit d36e9b
	fi
Packit d36e9b
Packit d36e9b
	if test "$pass" = conv; then
Packit d36e9b
	  # Only check for convenience libraries
Packit d36e9b
	  deplibs="$lib $deplibs"
Packit d36e9b
	  if test -z "$libdir"; then
Packit d36e9b
	    if test -z "$old_library"; then
Packit d36e9b
	      $echo "$modename: cannot find name of link library for \`$lib'" 1>&2
Packit d36e9b
	      exit $EXIT_FAILURE
Packit d36e9b
	    fi
Packit d36e9b
	    # It is a libtool convenience library, so add in its objects.
Packit d36e9b
	    convenience="$convenience $ladir/$objdir/$old_library"
Packit d36e9b
	    old_convenience="$old_convenience $ladir/$objdir/$old_library"
Packit d36e9b
	    tmp_libs=
Packit d36e9b
	    for deplib in $dependency_libs; do
Packit d36e9b
	      deplibs="$deplib $deplibs"
Packit d36e9b
              if test "X$duplicate_deps" = "Xyes" ; then
Packit d36e9b
	        case "$tmp_libs " in
Packit d36e9b
	        *" $deplib "*) specialdeplibs="$specialdeplibs $deplib" ;;
Packit d36e9b
	        esac
Packit d36e9b
              fi
Packit d36e9b
	      tmp_libs="$tmp_libs $deplib"
Packit d36e9b
	    done
Packit d36e9b
	  elif test "$linkmode" != prog && test "$linkmode" != lib; then
Packit d36e9b
	    $echo "$modename: \`$lib' is not a convenience library" 1>&2
Packit d36e9b
	    exit $EXIT_FAILURE
Packit d36e9b
	  fi
Packit d36e9b
	  continue
Packit d36e9b
	fi # $pass = conv
Packit d36e9b
Packit d36e9b
Packit d36e9b
	# Get the name of the library we link against.
Packit d36e9b
	linklib=
Packit d36e9b
	for l in $old_library $library_names; do
Packit d36e9b
	  linklib="$l"
Packit d36e9b
	done
Packit d36e9b
	if test -z "$linklib"; then
Packit d36e9b
	  $echo "$modename: cannot find name of link library for \`$lib'" 1>&2
Packit d36e9b
	  exit $EXIT_FAILURE
Packit d36e9b
	fi
Packit d36e9b
Packit d36e9b
	# This library was specified with -dlopen.
Packit d36e9b
	if test "$pass" = dlopen; then
Packit d36e9b
	  if test -z "$libdir"; then
Packit d36e9b
	    $echo "$modename: cannot -dlopen a convenience library: \`$lib'" 1>&2
Packit d36e9b
	    exit $EXIT_FAILURE
Packit d36e9b
	  fi
Packit d36e9b
	  if test -z "$dlname" ||
Packit d36e9b
	     test "$dlopen_support" != yes ||
Packit d36e9b
	     test "$build_libtool_libs" = no; then
Packit d36e9b
	    # If there is no dlname, no dlopen support or we're linking
Packit d36e9b
	    # statically, we need to preload.  We also need to preload any
Packit d36e9b
	    # dependent libraries so libltdl's deplib preloader doesn't
Packit d36e9b
	    # bomb out in the load deplibs phase.
Packit d36e9b
	    dlprefiles="$dlprefiles $lib $dependency_libs"
Packit d36e9b
	  else
Packit d36e9b
	    newdlfiles="$newdlfiles $lib"
Packit d36e9b
	  fi
Packit d36e9b
	  continue
Packit d36e9b
	fi # $pass = dlopen
Packit d36e9b
Packit d36e9b
	# We need an absolute path.
Packit d36e9b
	case $ladir in
Packit d36e9b
	[\\/]* | [A-Za-z]:[\\/]*) abs_ladir="$ladir" ;;
Packit d36e9b
	*)
Packit d36e9b
	  abs_ladir=`cd "$ladir" && pwd`
Packit d36e9b
	  if test -z "$abs_ladir"; then
Packit d36e9b
	    $echo "$modename: warning: cannot determine absolute directory name of \`$ladir'" 1>&2
Packit d36e9b
	    $echo "$modename: passing it literally to the linker, although it might fail" 1>&2
Packit d36e9b
	    abs_ladir="$ladir"
Packit d36e9b
	  fi
Packit d36e9b
	  ;;
Packit d36e9b
	esac
Packit d36e9b
	laname=`$echo "X$lib" | $Xsed -e 's%^.*/%%'`
Packit d36e9b
Packit d36e9b
	# Find the relevant object directory and library name.
Packit d36e9b
	if test "X$installed" = Xyes; then
Packit d36e9b
	  if test ! -f "$libdir/$linklib" && test -f "$abs_ladir/$linklib"; then
Packit d36e9b
	    $echo "$modename: warning: library \`$lib' was moved." 1>&2
Packit d36e9b
	    dir="$ladir"
Packit d36e9b
	    absdir="$abs_ladir"
Packit d36e9b
	    libdir="$abs_ladir"
Packit d36e9b
	  else
Packit d36e9b
	    dir="$libdir"
Packit d36e9b
	    absdir="$libdir"
Packit d36e9b
	  fi
Packit d36e9b
	  test "X$hardcode_automatic" = Xyes && avoidtemprpath=yes
Packit d36e9b
	else
Packit d36e9b
	  if test ! -f "$ladir/$objdir/$linklib" && test -f "$abs_ladir/$linklib"; then
Packit d36e9b
	    dir="$ladir"
Packit d36e9b
	    absdir="$abs_ladir"
Packit d36e9b
	    # Remove this search path later
Packit d36e9b
	    notinst_path="$notinst_path $abs_ladir"
Packit d36e9b
	  else
Packit d36e9b
	    dir="$ladir/$objdir"
Packit d36e9b
	    absdir="$abs_ladir/$objdir"
Packit d36e9b
	    # Remove this search path later
Packit d36e9b
	    notinst_path="$notinst_path $abs_ladir"
Packit d36e9b
	  fi
Packit d36e9b
	fi # $installed = yes
Packit d36e9b
	name=`$echo "X$laname" | $Xsed -e 's/\.la$//' -e 's/^lib//'`
Packit d36e9b
Packit d36e9b
	# This library was specified with -dlpreopen.
Packit d36e9b
	if test "$pass" = dlpreopen; then
Packit d36e9b
	  if test -z "$libdir"; then
Packit d36e9b
	    $echo "$modename: cannot -dlpreopen a convenience library: \`$lib'" 1>&2
Packit d36e9b
	    exit $EXIT_FAILURE
Packit d36e9b
	  fi
Packit d36e9b
	  # Prefer using a static library (so that no silly _DYNAMIC symbols
Packit d36e9b
	  # are required to link).
Packit d36e9b
	  if test -n "$old_library"; then
Packit d36e9b
	    newdlprefiles="$newdlprefiles $dir/$old_library"
Packit d36e9b
	  # Otherwise, use the dlname, so that lt_dlopen finds it.
Packit d36e9b
	  elif test -n "$dlname"; then
Packit d36e9b
	    newdlprefiles="$newdlprefiles $dir/$dlname"
Packit d36e9b
	  else
Packit d36e9b
	    newdlprefiles="$newdlprefiles $dir/$linklib"
Packit d36e9b
	  fi
Packit d36e9b
	fi # $pass = dlpreopen
Packit d36e9b
Packit d36e9b
	if test -z "$libdir"; then
Packit d36e9b
	  # Link the convenience library
Packit d36e9b
	  if test "$linkmode" = lib; then
Packit d36e9b
	    deplibs="$dir/$old_library $deplibs"
Packit d36e9b
	  elif test "$linkmode,$pass" = "prog,link"; then
Packit d36e9b
	    compile_deplibs="$dir/$old_library $compile_deplibs"
Packit d36e9b
	    finalize_deplibs="$dir/$old_library $finalize_deplibs"
Packit d36e9b
	  else
Packit d36e9b
	    deplibs="$lib $deplibs" # used for prog,scan pass
Packit d36e9b
	  fi
Packit d36e9b
	  continue
Packit d36e9b
	fi
Packit d36e9b
Packit d36e9b
Packit d36e9b
	if test "$linkmode" = prog && test "$pass" != link; then
Packit d36e9b
	  newlib_search_path="$newlib_search_path $ladir"
Packit d36e9b
	  deplibs="$lib $deplibs"
Packit d36e9b
Packit d36e9b
	  linkalldeplibs=no
Packit d36e9b
	  if test "$link_all_deplibs" != no || test -z "$library_names" ||
Packit d36e9b
	     test "$build_libtool_libs" = no; then
Packit d36e9b
	    linkalldeplibs=yes
Packit d36e9b
	  fi
Packit d36e9b
Packit d36e9b
	  tmp_libs=
Packit d36e9b
	  for deplib in $dependency_libs; do
Packit d36e9b
	    case $deplib in
Packit d36e9b
	    -L*) newlib_search_path="$newlib_search_path "`$echo "X$deplib" | $Xsed -e 's/^-L//'`;; ### testsuite: skip nested quoting test
Packit d36e9b
	    esac
Packit d36e9b
	    # Need to link against all dependency_libs?
Packit d36e9b
	    if test "$linkalldeplibs" = yes; then
Packit d36e9b
	      deplibs="$deplib $deplibs"
Packit d36e9b
	    else
Packit d36e9b
	      # Need to hardcode shared library paths
Packit d36e9b
	      # or/and link against static libraries
Packit d36e9b
	      newdependency_libs="$deplib $newdependency_libs"
Packit d36e9b
	    fi
Packit d36e9b
	    if test "X$duplicate_deps" = "Xyes" ; then
Packit d36e9b
	      case "$tmp_libs " in
Packit d36e9b
	      *" $deplib "*) specialdeplibs="$specialdeplibs $deplib" ;;
Packit d36e9b
	      esac
Packit d36e9b
	    fi
Packit d36e9b
	    tmp_libs="$tmp_libs $deplib"
Packit d36e9b
	  done # for deplib
Packit d36e9b
	  continue
Packit d36e9b
	fi # $linkmode = prog...
Packit d36e9b
Packit d36e9b
	if test "$linkmode,$pass" = "prog,link"; then
Packit d36e9b
	  if test -n "$library_names" &&
Packit d36e9b
         { { test "$prefer_static_libs" = no ||
Packit d36e9b
             test "$prefer_static_libs,$installed" = "built,yes"; } ||
Packit d36e9b
           test -z "$old_library"; }; then
Packit d36e9b
	    # We need to hardcode the library path
Packit d36e9b
	    if test -n "$shlibpath_var" && test -z "$avoidtemprpath" ; then
Packit d36e9b
	      # Make sure the rpath contains only unique directories.
Packit d36e9b
	      case "$temp_rpath " in
Packit d36e9b
	      *" $dir "*) ;;
Packit d36e9b
	      *" $absdir "*) ;;
Packit d36e9b
	      *) temp_rpath="$temp_rpath $absdir" ;;
Packit d36e9b
	      esac
Packit d36e9b
	    fi
Packit d36e9b
Packit d36e9b
	    # Hardcode the library path.
Packit d36e9b
	    # Skip directories that are in the system default run-time
Packit d36e9b
	    # search path.
Packit d36e9b
	    case " $sys_lib_dlsearch_path " in
Packit d36e9b
	    *" $absdir "*) ;;
Packit d36e9b
	    *)
Packit d36e9b
	      case "$compile_rpath " in
Packit d36e9b
	      *" $absdir "*) ;;
Packit d36e9b
	      *) compile_rpath="$compile_rpath $absdir"
Packit d36e9b
	      esac
Packit d36e9b
	      ;;
Packit d36e9b
	    esac
Packit d36e9b
	    case " $sys_lib_dlsearch_path " in
Packit d36e9b
	    *" $libdir "*) ;;
Packit d36e9b
	    *)
Packit d36e9b
	      case "$finalize_rpath " in
Packit d36e9b
	      *" $libdir "*) ;;
Packit d36e9b
	      *) finalize_rpath="$finalize_rpath $libdir"
Packit d36e9b
	      esac
Packit d36e9b
	      ;;
Packit d36e9b
	    esac
Packit d36e9b
	  fi # $linkmode,$pass = prog,link...
Packit d36e9b
Packit d36e9b
	  if test "$alldeplibs" = yes &&
Packit d36e9b
	     { test "$deplibs_check_method" = pass_all ||
Packit d36e9b
	       { test "$build_libtool_libs" = yes &&
Packit d36e9b
		 test -n "$library_names"; }; }; then
Packit d36e9b
	    # We only need to search for static libraries
Packit d36e9b
	    continue
Packit d36e9b
	  fi
Packit d36e9b
	fi
Packit d36e9b
Packit d36e9b
	link_static=no # Whether the deplib will be linked statically
Packit d36e9b
	use_static_libs=$prefer_static_libs
Packit d36e9b
	if test "$use_static_libs" = built && test "$installed" = yes ; then
Packit d36e9b
	  use_static_libs=no
Packit d36e9b
	fi
Packit d36e9b
	if test -n "$library_names" &&
Packit d36e9b
	   { test "$use_static_libs" = no || test -z "$old_library"; }; then
Packit d36e9b
	  if test "$installed" = no; then
Packit d36e9b
	    notinst_deplibs="$notinst_deplibs $lib"
Packit d36e9b
	    need_relink=yes
Packit d36e9b
	  fi
Packit d36e9b
	  # This is a shared library
Packit d36e9b
Packit d36e9b
	  # Warn about portability, can't link against -module's on
Packit d36e9b
	  # some systems (darwin)
Packit d36e9b
	  if test "$shouldnotlink" = yes && test "$pass" = link ; then
Packit d36e9b
	    $echo
Packit d36e9b
	    if test "$linkmode" = prog; then
Packit d36e9b
	      $echo "*** Warning: Linking the executable $output against the loadable module"
Packit d36e9b
	    else
Packit d36e9b
	      $echo "*** Warning: Linking the shared library $output against the loadable module"
Packit d36e9b
	    fi
Packit d36e9b
	    $echo "*** $linklib is not portable!"
Packit d36e9b
	  fi
Packit d36e9b
	  if test "$linkmode" = lib &&
Packit d36e9b
	     test "$hardcode_into_libs" = yes; then
Packit d36e9b
	    # Hardcode the library path.
Packit d36e9b
	    # Skip directories that are in the system default run-time
Packit d36e9b
	    # search path.
Packit d36e9b
	    case " $sys_lib_dlsearch_path " in
Packit d36e9b
	    *" $absdir "*) ;;
Packit d36e9b
	    *)
Packit d36e9b
	      case "$compile_rpath " in
Packit d36e9b
	      *" $absdir "*) ;;
Packit d36e9b
	      *) compile_rpath="$compile_rpath $absdir"
Packit d36e9b
	      esac
Packit d36e9b
	      ;;
Packit d36e9b
	    esac
Packit d36e9b
	    case " $sys_lib_dlsearch_path " in
Packit d36e9b
	    *" $libdir "*) ;;
Packit d36e9b
	    *)
Packit d36e9b
	      case "$finalize_rpath " in
Packit d36e9b
	      *" $libdir "*) ;;
Packit d36e9b
	      *) finalize_rpath="$finalize_rpath $libdir"
Packit d36e9b
	      esac
Packit d36e9b
	      ;;
Packit d36e9b
	    esac
Packit d36e9b
	  fi
Packit d36e9b
Packit d36e9b
	  if test -n "$old_archive_from_expsyms_cmds"; then
Packit d36e9b
	    # figure out the soname
Packit d36e9b
	    set dummy $library_names
Packit d36e9b
	    realname="$2"
Packit d36e9b
	    shift; shift
Packit d36e9b
	    libname=`eval \\$echo \"$libname_spec\"`
Packit d36e9b
	    # use dlname if we got it. it's perfectly good, no?
Packit d36e9b
	    if test -n "$dlname"; then
Packit d36e9b
	      soname="$dlname"
Packit d36e9b
	    elif test -n "$soname_spec"; then
Packit d36e9b
	      # bleh windows
Packit d36e9b
	      case $host in
Packit d36e9b
	      *cygwin* | mingw*)
Packit d36e9b
		major=`expr $current - $age`
Packit d36e9b
		versuffix="-$major"
Packit d36e9b
		;;
Packit d36e9b
	      esac
Packit d36e9b
	      eval soname=\"$soname_spec\"
Packit d36e9b
	    else
Packit d36e9b
	      soname="$realname"
Packit d36e9b
	    fi
Packit d36e9b
Packit d36e9b
	    # Make a new name for the extract_expsyms_cmds to use
Packit d36e9b
	    soroot="$soname"
Packit d36e9b
	    soname=`$echo $soroot | ${SED} -e 's/^.*\///'`
Packit d36e9b
	    newlib="libimp-`$echo $soname | ${SED} 's/^lib//;s/\.dll$//'`.a"
Packit d36e9b
Packit d36e9b
	    # If the library has no export list, then create one now
Packit d36e9b
	    if test -f "$output_objdir/$soname-def"; then :
Packit d36e9b
	    else
Packit d36e9b
	      $show "extracting exported symbol list from \`$soname'"
Packit d36e9b
	      save_ifs="$IFS"; IFS='~'
Packit d36e9b
	      cmds=$extract_expsyms_cmds
Packit d36e9b
	      for cmd in $cmds; do
Packit d36e9b
		IFS="$save_ifs"
Packit d36e9b
		eval cmd=\"$cmd\"
Packit d36e9b
		$show "$cmd"
Packit d36e9b
		$run eval "$cmd" || exit $?
Packit d36e9b
	      done
Packit d36e9b
	      IFS="$save_ifs"
Packit d36e9b
	    fi
Packit d36e9b
Packit d36e9b
	    # Create $newlib
Packit d36e9b
	    if test -f "$output_objdir/$newlib"; then :; else
Packit d36e9b
	      $show "generating import library for \`$soname'"
Packit d36e9b
	      save_ifs="$IFS"; IFS='~'
Packit d36e9b
	      cmds=$old_archive_from_expsyms_cmds
Packit d36e9b
	      for cmd in $cmds; do
Packit d36e9b
		IFS="$save_ifs"
Packit d36e9b
		eval cmd=\"$cmd\"
Packit d36e9b
		$show "$cmd"
Packit d36e9b
		$run eval "$cmd" || exit $?
Packit d36e9b
	      done
Packit d36e9b
	      IFS="$save_ifs"
Packit d36e9b
	    fi
Packit d36e9b
	    # make sure the library variables are pointing to the new library
Packit d36e9b
	    dir=$output_objdir
Packit d36e9b
	    linklib=$newlib
Packit d36e9b
	  fi # test -n "$old_archive_from_expsyms_cmds"
Packit d36e9b
Packit d36e9b
	  if test "$linkmode" = prog || test "$mode" != relink; then
Packit d36e9b
	    add_shlibpath=
Packit d36e9b
	    add_dir=
Packit d36e9b
	    add=
Packit d36e9b
	    lib_linked=yes
Packit d36e9b
	    case $hardcode_action in
Packit d36e9b
	    immediate | unsupported)
Packit d36e9b
	      if test "$hardcode_direct" = no; then
Packit d36e9b
		add="$dir/$linklib"
Packit d36e9b
		case $host in
Packit d36e9b
		  *-*-sco3.2v5.0.[024]*) add_dir="-L$dir" ;;
Packit d36e9b
		  *-*-sysv4*uw2*) add_dir="-L$dir" ;;
Packit d36e9b
		  *-*-sysv5OpenUNIX* | *-*-sysv5UnixWare7.[01].[10]* | \
Packit d36e9b
		    *-*-unixware7*) add_dir="-L$dir" ;;
Packit d36e9b
		  *-*-darwin* )
Packit d36e9b
		    # if the lib is a module then we can not link against
Packit d36e9b
		    # it, someone is ignoring the new warnings I added
Packit d36e9b
		    if /usr/bin/file -L $add 2> /dev/null |
Packit d36e9b
                      $EGREP ": [^:]* bundle" >/dev/null ; then
Packit d36e9b
		      $echo "** Warning, lib $linklib is a module, not a shared library"
Packit d36e9b
		      if test -z "$old_library" ; then
Packit d36e9b
		        $echo
Packit d36e9b
		        $echo "** And there doesn't seem to be a static archive available"
Packit d36e9b
		        $echo "** The link will probably fail, sorry"
Packit d36e9b
		      else
Packit d36e9b
		        add="$dir/$old_library"
Packit d36e9b
		      fi
Packit d36e9b
		    fi
Packit d36e9b
		esac
Packit d36e9b
	      elif test "$hardcode_minus_L" = no; then
Packit d36e9b
		case $host in
Packit d36e9b
		*-*-sunos*) add_shlibpath="$dir" ;;
Packit d36e9b
		esac
Packit d36e9b
		add_dir="-L$dir"
Packit d36e9b
		add="-l$name"
Packit d36e9b
	      elif test "$hardcode_shlibpath_var" = no; then
Packit d36e9b
		add_shlibpath="$dir"
Packit d36e9b
		add="-l$name"
Packit d36e9b
	      else
Packit d36e9b
		lib_linked=no
Packit d36e9b
	      fi
Packit d36e9b
	      ;;
Packit d36e9b
	    relink)
Packit d36e9b
	      if test "$hardcode_direct" = yes; then
Packit d36e9b
		add="$dir/$linklib"
Packit d36e9b
	      elif test "$hardcode_minus_L" = yes; then
Packit d36e9b
		add_dir="-L$dir"
Packit d36e9b
		# Try looking first in the location we're being installed to.
Packit d36e9b
		if test -n "$inst_prefix_dir"; then
Packit d36e9b
		  case $libdir in
Packit d36e9b
		    [\\/]*)
Packit d36e9b
		      add_dir="$add_dir -L$inst_prefix_dir$libdir"
Packit d36e9b
		      ;;
Packit d36e9b
		  esac
Packit d36e9b
		fi
Packit d36e9b
		add="-l$name"
Packit d36e9b
	      elif test "$hardcode_shlibpath_var" = yes; then
Packit d36e9b
		add_shlibpath="$dir"
Packit d36e9b
		add="-l$name"
Packit d36e9b
	      else
Packit d36e9b
		lib_linked=no
Packit d36e9b
	      fi
Packit d36e9b
	      ;;
Packit d36e9b
	    *) lib_linked=no ;;
Packit d36e9b
	    esac
Packit d36e9b
Packit d36e9b
	    if test "$lib_linked" != yes; then
Packit d36e9b
	      $echo "$modename: configuration error: unsupported hardcode properties"
Packit d36e9b
	      exit $EXIT_FAILURE
Packit d36e9b
	    fi
Packit d36e9b
Packit d36e9b
	    if test -n "$add_shlibpath"; then
Packit d36e9b
	      case :$compile_shlibpath: in
Packit d36e9b
	      *":$add_shlibpath:"*) ;;
Packit d36e9b
	      *) compile_shlibpath="$compile_shlibpath$add_shlibpath:" ;;
Packit d36e9b
	      esac
Packit d36e9b
	    fi
Packit d36e9b
	    if test "$linkmode" = prog; then
Packit d36e9b
	      test -n "$add_dir" && compile_deplibs="$add_dir $compile_deplibs"
Packit d36e9b
	      test -n "$add" && compile_deplibs="$add $compile_deplibs"
Packit d36e9b
	    else
Packit d36e9b
	      test -n "$add_dir" && deplibs="$add_dir $deplibs"
Packit d36e9b
	      test -n "$add" && deplibs="$add $deplibs"
Packit d36e9b
	      if test "$hardcode_direct" != yes && \
Packit d36e9b
		 test "$hardcode_minus_L" != yes && \
Packit d36e9b
		 test "$hardcode_shlibpath_var" = yes; then
Packit d36e9b
		case :$finalize_shlibpath: in
Packit d36e9b
		*":$libdir:"*) ;;
Packit d36e9b
		*) finalize_shlibpath="$finalize_shlibpath$libdir:" ;;
Packit d36e9b
		esac
Packit d36e9b
	      fi
Packit d36e9b
	    fi
Packit d36e9b
	  fi
Packit d36e9b
Packit d36e9b
	  if test "$linkmode" = prog || test "$mode" = relink; then
Packit d36e9b
	    add_shlibpath=
Packit d36e9b
	    add_dir=
Packit d36e9b
	    add=
Packit d36e9b
	    # Finalize command for both is simple: just hardcode it.
Packit d36e9b
	    if test "$hardcode_direct" = yes; then
Packit d36e9b
	      add="$libdir/$linklib"
Packit d36e9b
	    elif test "$hardcode_minus_L" = yes; then
Packit d36e9b
	      add_dir="-L$libdir"
Packit d36e9b
	      add="-l$name"
Packit d36e9b
	    elif test "$hardcode_shlibpath_var" = yes; then
Packit d36e9b
	      case :$finalize_shlibpath: in
Packit d36e9b
	      *":$libdir:"*) ;;
Packit d36e9b
	      *) finalize_shlibpath="$finalize_shlibpath$libdir:" ;;
Packit d36e9b
	      esac
Packit d36e9b
	      add="-l$name"
Packit d36e9b
	    elif test "$hardcode_automatic" = yes; then
Packit d36e9b
	      if test -n "$inst_prefix_dir" &&
Packit d36e9b
		 test -f "$inst_prefix_dir$libdir/$linklib" ; then
Packit d36e9b
	        add="$inst_prefix_dir$libdir/$linklib"
Packit d36e9b
	      else
Packit d36e9b
	        add="$libdir/$linklib"
Packit d36e9b
	      fi
Packit d36e9b
	    else
Packit d36e9b
	      # We cannot seem to hardcode it, guess we'll fake it.
Packit d36e9b
	      add_dir="-L$libdir"
Packit d36e9b
	      # Try looking first in the location we're being installed to.
Packit d36e9b
	      if test -n "$inst_prefix_dir"; then
Packit d36e9b
		case $libdir in
Packit d36e9b
		  [\\/]*)
Packit d36e9b
		    add_dir="$add_dir -L$inst_prefix_dir$libdir"
Packit d36e9b
		    ;;
Packit d36e9b
		esac
Packit d36e9b
	      fi
Packit d36e9b
	      add="-l$name"
Packit d36e9b
	    fi
Packit d36e9b
Packit d36e9b
	    if test "$linkmode" = prog; then
Packit d36e9b
	      test -n "$add_dir" && finalize_deplibs="$add_dir $finalize_deplibs"
Packit d36e9b
	      test -n "$add" && finalize_deplibs="$add $finalize_deplibs"
Packit d36e9b
	    else
Packit d36e9b
	      test -n "$add_dir" && deplibs="$add_dir $deplibs"
Packit d36e9b
	      test -n "$add" && deplibs="$add $deplibs"
Packit d36e9b
	    fi
Packit d36e9b
	  fi
Packit d36e9b
	elif test "$linkmode" = prog; then
Packit d36e9b
	  # Here we assume that one of hardcode_direct or hardcode_minus_L
Packit d36e9b
	  # is not unsupported.  This is valid on all known static and
Packit d36e9b
	  # shared platforms.
Packit d36e9b
	  if test "$hardcode_direct" != unsupported; then
Packit d36e9b
	    test -n "$old_library" && linklib="$old_library"
Packit d36e9b
	    compile_deplibs="$dir/$linklib $compile_deplibs"
Packit d36e9b
	    finalize_deplibs="$dir/$linklib $finalize_deplibs"
Packit d36e9b
	  else
Packit d36e9b
	    compile_deplibs="-l$name -L$dir $compile_deplibs"
Packit d36e9b
	    finalize_deplibs="-l$name -L$dir $finalize_deplibs"
Packit d36e9b
	  fi
Packit d36e9b
	elif test "$build_libtool_libs" = yes; then
Packit d36e9b
	  # Not a shared library
Packit d36e9b
	  if test "$deplibs_check_method" != pass_all; then
Packit d36e9b
	    # We're trying link a shared library against a static one
Packit d36e9b
	    # but the system doesn't support it.
Packit d36e9b
Packit d36e9b
	    # Just print a warning and add the library to dependency_libs so
Packit d36e9b
	    # that the program can be linked against the static library.
Packit d36e9b
	    $echo
Packit d36e9b
	    $echo "*** Warning: This system can not link to static lib archive $lib."
Packit d36e9b
	    $echo "*** I have the capability to make that library automatically link in when"
Packit d36e9b
	    $echo "*** you link to this library.  But I can only do this if you have a"
Packit d36e9b
	    $echo "*** shared version of the library, which you do not appear to have."
Packit d36e9b
	    if test "$module" = yes; then
Packit d36e9b
	      $echo "*** But as you try to build a module library, libtool will still create "
Packit d36e9b
	      $echo "*** a static module, that should work as long as the dlopening application"
Packit d36e9b
	      $echo "*** is linked with the -dlopen flag to resolve symbols at runtime."
Packit d36e9b
	      if test -z "$global_symbol_pipe"; then
Packit d36e9b
		$echo
Packit d36e9b
		$echo "*** However, this would only work if libtool was able to extract symbol"
Packit d36e9b
		$echo "*** lists from a program, using \`nm' or equivalent, but libtool could"
Packit d36e9b
		$echo "*** not find such a program.  So, this module is probably useless."
Packit d36e9b
		$echo "*** \`nm' from GNU binutils and a full rebuild may help."
Packit d36e9b
	      fi
Packit d36e9b
	      if test "$build_old_libs" = no; then
Packit d36e9b
		build_libtool_libs=module
Packit d36e9b
		build_old_libs=yes
Packit d36e9b
	      else
Packit d36e9b
		build_libtool_libs=no
Packit d36e9b
	      fi
Packit d36e9b
	    fi
Packit d36e9b
	  else
Packit d36e9b
	    deplibs="$dir/$old_library $deplibs"
Packit d36e9b
	    link_static=yes
Packit d36e9b
	  fi
Packit d36e9b
	fi # link shared/static library?
Packit d36e9b
Packit d36e9b
	if test "$linkmode" = lib; then
Packit d36e9b
	  if test -n "$dependency_libs" &&
Packit d36e9b
	     { test "$hardcode_into_libs" != yes ||
Packit d36e9b
	       test "$build_old_libs" = yes ||
Packit d36e9b
	       test "$link_static" = yes; }; then
Packit d36e9b
	    # Extract -R from dependency_libs
Packit d36e9b
	    temp_deplibs=
Packit d36e9b
	    for libdir in $dependency_libs; do
Packit d36e9b
	      case $libdir in
Packit d36e9b
	      -R*) temp_xrpath=`$echo "X$libdir" | $Xsed -e 's/^-R//'`
Packit d36e9b
		   case " $xrpath " in
Packit d36e9b
		   *" $temp_xrpath "*) ;;
Packit d36e9b
		   *) xrpath="$xrpath $temp_xrpath";;
Packit d36e9b
		   esac;;
Packit d36e9b
	      *) temp_deplibs="$temp_deplibs $libdir";;
Packit d36e9b
	      esac
Packit d36e9b
	    done
Packit d36e9b
	    dependency_libs="$temp_deplibs"
Packit d36e9b
	  fi
Packit d36e9b
Packit d36e9b
	  newlib_search_path="$newlib_search_path $absdir"
Packit d36e9b
	  # Link against this library
Packit d36e9b
	  test "$link_static" = no && newdependency_libs="$abs_ladir/$laname $newdependency_libs"
Packit d36e9b
	  # ... and its dependency_libs
Packit d36e9b
	  tmp_libs=
Packit d36e9b
	  for deplib in $dependency_libs; do
Packit d36e9b
	    newdependency_libs="$deplib $newdependency_libs"
Packit d36e9b
	    if test "X$duplicate_deps" = "Xyes" ; then
Packit d36e9b
	      case "$tmp_libs " in
Packit d36e9b
	      *" $deplib "*) specialdeplibs="$specialdeplibs $deplib" ;;
Packit d36e9b
	      esac
Packit d36e9b
	    fi
Packit d36e9b
	    tmp_libs="$tmp_libs $deplib"
Packit d36e9b
	  done
Packit d36e9b
Packit d36e9b
	  if test "$link_all_deplibs" != no; then
Packit d36e9b
	    # Add the search paths of all dependency libraries
Packit d36e9b
	    for deplib in $dependency_libs; do
Packit d36e9b
	      case $deplib in
Packit d36e9b
	      -L*) path="$deplib" ;;
Packit d36e9b
	      *.la)
Packit d36e9b
		dir=`$echo "X$deplib" | $Xsed -e 's%/[^/]*$%%'`
Packit d36e9b
		test "X$dir" = "X$deplib" && dir="."
Packit d36e9b
		# We need an absolute path.
Packit d36e9b
		case $dir in
Packit d36e9b
		[\\/]* | [A-Za-z]:[\\/]*) absdir="$dir" ;;
Packit d36e9b
		*)
Packit d36e9b
		  absdir=`cd "$dir" && pwd`
Packit d36e9b
		  if test -z "$absdir"; then
Packit d36e9b
		    $echo "$modename: warning: cannot determine absolute directory name of \`$dir'" 1>&2
Packit d36e9b
		    absdir="$dir"
Packit d36e9b
		  fi
Packit d36e9b
		  ;;
Packit d36e9b
		esac
Packit d36e9b
		if grep "^installed=no" $deplib > /dev/null; then
Packit d36e9b
		  path="$absdir/$objdir"
Packit d36e9b
		else
Packit d36e9b
		  eval libdir=`${SED} -n -e 's/^libdir=\(.*\)$/\1/p' $deplib`
Packit d36e9b
		  if test -z "$libdir"; then
Packit d36e9b
		    $echo "$modename: \`$deplib' is not a valid libtool archive" 1>&2
Packit d36e9b
		    exit $EXIT_FAILURE
Packit d36e9b
		  fi
Packit d36e9b
		  if test "$absdir" != "$libdir"; then
Packit d36e9b
		    $echo "$modename: warning: \`$deplib' seems to be moved" 1>&2
Packit d36e9b
		  fi
Packit d36e9b
		  path="$absdir"
Packit d36e9b
		fi
Packit d36e9b
		depdepl=
Packit d36e9b
		case $host in
Packit d36e9b
		*-*-darwin*)
Packit d36e9b
		  # we do not want to link against static libs,
Packit d36e9b
		  # but need to link against shared
Packit d36e9b
		  eval deplibrary_names=`${SED} -n -e 's/^library_names=\(.*\)$/\1/p' $deplib`
Packit d36e9b
		  if test -n "$deplibrary_names" ; then
Packit d36e9b
		    for tmp in $deplibrary_names ; do
Packit d36e9b
		      depdepl=$tmp
Packit d36e9b
		    done
Packit d36e9b
		    if test -f "$path/$depdepl" ; then
Packit d36e9b
		      depdepl="$path/$depdepl"
Packit d36e9b
		    fi
Packit d36e9b
		    # do not add paths which are already there
Packit d36e9b
		    case " $newlib_search_path " in
Packit d36e9b
		    *" $path "*) ;;
Packit d36e9b
		    *) newlib_search_path="$newlib_search_path $path";;
Packit d36e9b
		    esac
Packit d36e9b
		  fi
Packit d36e9b
		  path=""
Packit d36e9b
		  ;;
Packit d36e9b
		*)
Packit d36e9b
		  path="-L$path"
Packit d36e9b
		  ;;
Packit d36e9b
		esac
Packit d36e9b
		;;
Packit d36e9b
	      -l*)
Packit d36e9b
		case $host in
Packit d36e9b
		*-*-darwin*)
Packit d36e9b
		  # Again, we only want to link against shared libraries
Packit d36e9b
		  eval tmp_libs=`$echo "X$deplib" | $Xsed -e "s,^\-l,,"`
Packit d36e9b
		  for tmp in $newlib_search_path ; do
Packit d36e9b
		    if test -f "$tmp/lib$tmp_libs.dylib" ; then
Packit d36e9b
		      eval depdepl="$tmp/lib$tmp_libs.dylib"
Packit d36e9b
		      break
Packit d36e9b
		    fi
Packit d36e9b
		  done
Packit d36e9b
		  path=""
Packit d36e9b
		  ;;
Packit d36e9b
		*) continue ;;
Packit d36e9b
		esac
Packit d36e9b
		;;
Packit d36e9b
	      *) continue ;;
Packit d36e9b
	      esac
Packit d36e9b
	      case " $deplibs " in
Packit d36e9b
	      *" $path "*) ;;
Packit d36e9b
	      *) deplibs="$path $deplibs" ;;
Packit d36e9b
	      esac
Packit d36e9b
	      case " $deplibs " in
Packit d36e9b
	      *" $depdepl "*) ;;
Packit d36e9b
	      *) deplibs="$depdepl $deplibs" ;;
Packit d36e9b
	      esac
Packit d36e9b
	    done
Packit d36e9b
	  fi # link_all_deplibs != no
Packit d36e9b
	fi # linkmode = lib
Packit d36e9b
      done # for deplib in $libs
Packit d36e9b
      dependency_libs="$newdependency_libs"
Packit d36e9b
      if test "$pass" = dlpreopen; then
Packit d36e9b
	# Link the dlpreopened libraries before other libraries
Packit d36e9b
	for deplib in $save_deplibs; do
Packit d36e9b
	  deplibs="$deplib $deplibs"
Packit d36e9b
	done
Packit d36e9b
      fi
Packit d36e9b
      if test "$pass" != dlopen; then
Packit d36e9b
	if test "$pass" != conv; then
Packit d36e9b
	  # Make sure lib_search_path contains only unique directories.
Packit d36e9b
	  lib_search_path=
Packit d36e9b
	  for dir in $newlib_search_path; do
Packit d36e9b
	    case "$lib_search_path " in
Packit d36e9b
	    *" $dir "*) ;;
Packit d36e9b
	    *) lib_search_path="$lib_search_path $dir" ;;
Packit d36e9b
	    esac
Packit d36e9b
	  done
Packit d36e9b
	  newlib_search_path=
Packit d36e9b
	fi
Packit d36e9b
Packit d36e9b
	if test "$linkmode,$pass" != "prog,link"; then
Packit d36e9b
	  vars="deplibs"
Packit d36e9b
	else
Packit d36e9b
	  vars="compile_deplibs finalize_deplibs"
Packit d36e9b
	fi
Packit d36e9b
	for var in $vars dependency_libs; do
Packit d36e9b
	  # Add libraries to $var in reverse order
Packit d36e9b
	  eval tmp_libs=\"\$$var\"
Packit d36e9b
	  new_libs=
Packit d36e9b
	  for deplib in $tmp_libs; do
Packit d36e9b
	    # FIXME: Pedantically, this is the right thing to do, so
Packit d36e9b
	    #        that some nasty dependency loop isn't accidentally
Packit d36e9b
	    #        broken:
Packit d36e9b
	    #new_libs="$deplib $new_libs"
Packit d36e9b
	    # Pragmatically, this seems to cause very few problems in
Packit d36e9b
	    # practice:
Packit d36e9b
	    case $deplib in
Packit d36e9b
	    -L*) new_libs="$deplib $new_libs" ;;
Packit d36e9b
	    -R*) ;;
Packit d36e9b
	    *)
Packit d36e9b
	      # And here is the reason: when a library appears more
Packit d36e9b
	      # than once as an explicit dependence of a library, or
Packit d36e9b
	      # is implicitly linked in more than once by the
Packit d36e9b
	      # compiler, it is considered special, and multiple
Packit d36e9b
	      # occurrences thereof are not removed.  Compare this
Packit d36e9b
	      # with having the same library being listed as a
Packit d36e9b
	      # dependency of multiple other libraries: in this case,
Packit d36e9b
	      # we know (pedantically, we assume) the library does not
Packit d36e9b
	      # need to be listed more than once, so we keep only the
Packit d36e9b
	      # last copy.  This is not always right, but it is rare
Packit d36e9b
	      # enough that we require users that really mean to play
Packit d36e9b
	      # such unportable linking tricks to link the library
Packit d36e9b
	      # using -Wl,-lname, so that libtool does not consider it
Packit d36e9b
	      # for duplicate removal.
Packit d36e9b
	      case " $specialdeplibs " in
Packit d36e9b
	      *" $deplib "*) new_libs="$deplib $new_libs" ;;
Packit d36e9b
	      *)
Packit d36e9b
		case " $new_libs " in
Packit d36e9b
		*" $deplib "*) ;;
Packit d36e9b
		*) new_libs="$deplib $new_libs" ;;
Packit d36e9b
		esac
Packit d36e9b
		;;
Packit d36e9b
	      esac
Packit d36e9b
	      ;;
Packit d36e9b
	    esac
Packit d36e9b
	  done
Packit d36e9b
	  tmp_libs=
Packit d36e9b
	  for deplib in $new_libs; do
Packit d36e9b
	    case $deplib in
Packit d36e9b
	    -L*)
Packit d36e9b
	      case " $tmp_libs " in
Packit d36e9b
	      *" $deplib "*) ;;
Packit d36e9b
	      *) tmp_libs="$tmp_libs $deplib" ;;
Packit d36e9b
	      esac
Packit d36e9b
	      ;;
Packit d36e9b
	    *) tmp_libs="$tmp_libs $deplib" ;;
Packit d36e9b
	    esac
Packit d36e9b
	  done
Packit d36e9b
	  eval $var=\"$tmp_libs\"
Packit d36e9b
	done # for var
Packit d36e9b
      fi
Packit d36e9b
      # Last step: remove runtime libs from dependency_libs
Packit d36e9b
      # (they stay in deplibs)
Packit d36e9b
      tmp_libs=
Packit d36e9b
      for i in $dependency_libs ; do
Packit d36e9b
	case " $predeps $postdeps $compiler_lib_search_path " in
Packit d36e9b
	*" $i "*)
Packit d36e9b
	  i=""
Packit d36e9b
	  ;;
Packit d36e9b
	esac
Packit d36e9b
	if test -n "$i" ; then
Packit d36e9b
	  tmp_libs="$tmp_libs $i"
Packit d36e9b
	fi
Packit d36e9b
      done
Packit d36e9b
      dependency_libs=$tmp_libs
Packit d36e9b
    done # for pass
Packit d36e9b
    if test "$linkmode" = prog; then
Packit d36e9b
      dlfiles="$newdlfiles"
Packit d36e9b
      dlprefiles="$newdlprefiles"
Packit d36e9b
    fi
Packit d36e9b
Packit d36e9b
    case $linkmode in
Packit d36e9b
    oldlib)
Packit d36e9b
      if test -n "$deplibs"; then
Packit d36e9b
	$echo "$modename: warning: \`-l' and \`-L' are ignored for archives" 1>&2
Packit d36e9b
      fi
Packit d36e9b
Packit d36e9b
      if test -n "$dlfiles$dlprefiles" || test "$dlself" != no; then
Packit d36e9b
	$echo "$modename: warning: \`-dlopen' is ignored for archives" 1>&2
Packit d36e9b
      fi
Packit d36e9b
Packit d36e9b
      if test -n "$rpath"; then
Packit d36e9b
	$echo "$modename: warning: \`-rpath' is ignored for archives" 1>&2
Packit d36e9b
      fi
Packit d36e9b
Packit d36e9b
      if test -n "$xrpath"; then
Packit d36e9b
	$echo "$modename: warning: \`-R' is ignored for archives" 1>&2
Packit d36e9b
      fi
Packit d36e9b
Packit d36e9b
      if test -n "$vinfo"; then
Packit d36e9b
	$echo "$modename: warning: \`-version-info/-version-number' is ignored for archives" 1>&2
Packit d36e9b
      fi
Packit d36e9b
Packit d36e9b
      if test -n "$release"; then
Packit d36e9b
	$echo "$modename: warning: \`-release' is ignored for archives" 1>&2
Packit d36e9b
      fi
Packit d36e9b
Packit d36e9b
      if test -n "$export_symbols" || test -n "$export_symbols_regex"; then
Packit d36e9b
	$echo "$modename: warning: \`-export-symbols' is ignored for archives" 1>&2
Packit d36e9b
      fi
Packit d36e9b
Packit d36e9b
      # Now set the variables for building old libraries.
Packit d36e9b
      build_libtool_libs=no
Packit d36e9b
      oldlibs="$output"
Packit d36e9b
      objs="$objs$old_deplibs"
Packit d36e9b
      ;;
Packit d36e9b
Packit d36e9b
    lib)
Packit d36e9b
      # Make sure we only generate libraries of the form `libNAME.la'.
Packit d36e9b
      case $outputname in
Packit d36e9b
      lib*)
Packit d36e9b
	name=`$echo "X$outputname" | $Xsed -e 's/\.la$//' -e 's/^lib//'`
Packit d36e9b
	eval shared_ext=\"$shrext_cmds\"
Packit d36e9b
	eval libname=\"$libname_spec\"
Packit d36e9b
	;;
Packit d36e9b
      *)
Packit d36e9b
	if test "$module" = no; then
Packit d36e9b
	  $echo "$modename: libtool library \`$output' must begin with \`lib'" 1>&2
Packit d36e9b
	  $echo "$help" 1>&2
Packit d36e9b
	  exit $EXIT_FAILURE
Packit d36e9b
	fi
Packit d36e9b
	if test "$need_lib_prefix" != no; then
Packit d36e9b
	  # Add the "lib" prefix for modules if required
Packit d36e9b
	  name=`$echo "X$outputname" | $Xsed -e 's/\.la$//'`
Packit d36e9b
	  eval shared_ext=\"$shrext_cmds\"
Packit d36e9b
	  eval libname=\"$libname_spec\"
Packit d36e9b
	else
Packit d36e9b
	  libname=`$echo "X$outputname" | $Xsed -e 's/\.la$//'`
Packit d36e9b
	fi
Packit d36e9b
	;;
Packit d36e9b
      esac
Packit d36e9b
Packit d36e9b
      if test -n "$objs"; then
Packit d36e9b
	if test "$deplibs_check_method" != pass_all; then
Packit d36e9b
	  $echo "$modename: cannot build libtool library \`$output' from non-libtool objects on this host:$objs" 2>&1
Packit d36e9b
	  exit $EXIT_FAILURE
Packit d36e9b
	else
Packit d36e9b
	  $echo
Packit d36e9b
	  $echo "*** Warning: Linking the shared library $output against the non-libtool"
Packit d36e9b
	  $echo "*** objects $objs is not portable!"
Packit d36e9b
	  libobjs="$libobjs $objs"
Packit d36e9b
	fi
Packit d36e9b
      fi
Packit d36e9b
Packit d36e9b
      if test "$dlself" != no; then
Packit d36e9b
	$echo "$modename: warning: \`-dlopen self' is ignored for libtool libraries" 1>&2
Packit d36e9b
      fi
Packit d36e9b
Packit d36e9b
      set dummy $rpath
Packit d36e9b
      if test "$#" -gt 2; then
Packit d36e9b
	$echo "$modename: warning: ignoring multiple \`-rpath's for a libtool library" 1>&2
Packit d36e9b
      fi
Packit d36e9b
      install_libdir="$2"
Packit d36e9b
Packit d36e9b
      oldlibs=
Packit d36e9b
      if test -z "$rpath"; then
Packit d36e9b
	if test "$build_libtool_libs" = yes; then
Packit d36e9b
	  # Building a libtool convenience library.
Packit d36e9b
	  # Some compilers have problems with a `.al' extension so
Packit d36e9b
	  # convenience libraries should have the same extension an
Packit d36e9b
	  # archive normally would.
Packit d36e9b
	  oldlibs="$output_objdir/$libname.$libext $oldlibs"
Packit d36e9b
	  build_libtool_libs=convenience
Packit d36e9b
	  build_old_libs=yes
Packit d36e9b
	fi
Packit d36e9b
Packit d36e9b
	if test -n "$vinfo"; then
Packit d36e9b
	  $echo "$modename: warning: \`-version-info/-version-number' is ignored for convenience libraries" 1>&2
Packit d36e9b
	fi
Packit d36e9b
Packit d36e9b
	if test -n "$release"; then
Packit d36e9b
	  $echo "$modename: warning: \`-release' is ignored for convenience libraries" 1>&2
Packit d36e9b
	fi
Packit d36e9b
      else
Packit d36e9b
Packit d36e9b
	# Parse the version information argument.
Packit d36e9b
	save_ifs="$IFS"; IFS=':'
Packit d36e9b
	set dummy $vinfo 0 0 0
Packit d36e9b
	IFS="$save_ifs"
Packit d36e9b
Packit d36e9b
	if test -n "$8"; then
Packit d36e9b
	  $echo "$modename: too many parameters to \`-version-info'" 1>&2
Packit d36e9b
	  $echo "$help" 1>&2
Packit d36e9b
	  exit $EXIT_FAILURE
Packit d36e9b
	fi
Packit d36e9b
Packit d36e9b
	# convert absolute version numbers to libtool ages
Packit d36e9b
	# this retains compatibility with .la files and attempts
Packit d36e9b
	# to make the code below a bit more comprehensible
Packit d36e9b
Packit d36e9b
	case $vinfo_number in
Packit d36e9b
	yes)
Packit d36e9b
	  number_major="$2"
Packit d36e9b
	  number_minor="$3"
Packit d36e9b
	  number_revision="$4"
Packit d36e9b
	  #
Packit d36e9b
	  # There are really only two kinds -- those that
Packit d36e9b
	  # use the current revision as the major version
Packit d36e9b
	  # and those that subtract age and use age as
Packit d36e9b
	  # a minor version.  But, then there is irix
Packit d36e9b
	  # which has an extra 1 added just for fun
Packit d36e9b
	  #
Packit d36e9b
	  case $version_type in
Packit d36e9b
	  darwin|linux|osf|windows|none)
Packit d36e9b
	    current=`expr $number_major + $number_minor`
Packit d36e9b
	    age="$number_minor"
Packit d36e9b
	    revision="$number_revision"
Packit d36e9b
	    ;;
Packit d36e9b
	  freebsd-aout|freebsd-elf|sunos)
Packit d36e9b
	    current="$number_major"
Packit d36e9b
	    revision="$number_minor"
Packit d36e9b
	    age="0"
Packit d36e9b
	    ;;
Packit d36e9b
	  irix|nonstopux)
Packit d36e9b
	    current=`expr $number_major + $number_minor - 1`
Packit d36e9b
	    age="$number_minor"
Packit d36e9b
	    revision="$number_minor"
Packit d36e9b
	    ;;
Packit d36e9b
	  esac
Packit d36e9b
	  ;;
Packit d36e9b
	no)
Packit d36e9b
	  current="$2"
Packit d36e9b
	  revision="$3"
Packit d36e9b
	  age="$4"
Packit d36e9b
	  ;;
Packit d36e9b
	esac
Packit d36e9b
Packit d36e9b
	# Check that each of the things are valid numbers.
Packit d36e9b
	case $current in
Packit d36e9b
	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]) ;;
Packit d36e9b
	*)
Packit d36e9b
	  $echo "$modename: CURRENT \`$current' must be a nonnegative integer" 1>&2
Packit d36e9b
	  $echo "$modename: \`$vinfo' is not valid version information" 1>&2
Packit d36e9b
	  exit $EXIT_FAILURE
Packit d36e9b
	  ;;
Packit d36e9b
	esac
Packit d36e9b
Packit d36e9b
	case $revision in
Packit d36e9b
	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]) ;;
Packit d36e9b
	*)
Packit d36e9b
	  $echo "$modename: REVISION \`$revision' must be a nonnegative integer" 1>&2
Packit d36e9b
	  $echo "$modename: \`$vinfo' is not valid version information" 1>&2
Packit d36e9b
	  exit $EXIT_FAILURE
Packit d36e9b
	  ;;
Packit d36e9b
	esac
Packit d36e9b
Packit d36e9b
	case $age in
Packit d36e9b
	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]) ;;
Packit d36e9b
	*)
Packit d36e9b
	  $echo "$modename: AGE \`$age' must be a nonnegative integer" 1>&2
Packit d36e9b
	  $echo "$modename: \`$vinfo' is not valid version information" 1>&2
Packit d36e9b
	  exit $EXIT_FAILURE
Packit d36e9b
	  ;;
Packit d36e9b
	esac
Packit d36e9b
Packit d36e9b
	if test "$age" -gt "$current"; then
Packit d36e9b
	  $echo "$modename: AGE \`$age' is greater than the current interface number \`$current'" 1>&2
Packit d36e9b
	  $echo "$modename: \`$vinfo' is not valid version information" 1>&2
Packit d36e9b
	  exit $EXIT_FAILURE
Packit d36e9b
	fi
Packit d36e9b
Packit d36e9b
	# Calculate the version variables.
Packit d36e9b
	major=
Packit d36e9b
	versuffix=
Packit d36e9b
	verstring=
Packit d36e9b
	case $version_type in
Packit d36e9b
	none) ;;
Packit d36e9b
Packit d36e9b
	darwin)
Packit d36e9b
	  # Like Linux, but with the current version available in
Packit d36e9b
	  # verstring for coding it into the library header
Packit d36e9b
	  major=.`expr $current - $age`
Packit d36e9b
	  versuffix="$major.$age.$revision"
Packit d36e9b
	  # Darwin ld doesn't like 0 for these options...
Packit d36e9b
	  minor_current=`expr $current + 1`
Packit d36e9b
	  verstring="${wl}-compatibility_version ${wl}$minor_current ${wl}-current_version ${wl}$minor_current.$revision"
Packit d36e9b
	  ;;
Packit d36e9b
Packit d36e9b
	freebsd-aout)
Packit d36e9b
	  major=".$current"
Packit d36e9b
	  versuffix=".$current.$revision";
Packit d36e9b
	  ;;
Packit d36e9b
Packit d36e9b
	freebsd-elf)
Packit d36e9b
	  major=".$current"
Packit d36e9b
	  versuffix=".$current";
Packit d36e9b
	  ;;
Packit d36e9b
Packit d36e9b
	irix | nonstopux)
Packit d36e9b
	  major=`expr $current - $age + 1`
Packit d36e9b
Packit d36e9b
	  case $version_type in
Packit d36e9b
	    nonstopux) verstring_prefix=nonstopux ;;
Packit d36e9b
	    *)         verstring_prefix=sgi ;;
Packit d36e9b
	  esac
Packit d36e9b
	  verstring="$verstring_prefix$major.$revision"
Packit d36e9b
Packit d36e9b
	  # Add in all the interfaces that we are compatible with.
Packit d36e9b
	  loop=$revision
Packit d36e9b
	  while test "$loop" -ne 0; do
Packit d36e9b
	    iface=`expr $revision - $loop`
Packit d36e9b
	    loop=`expr $loop - 1`
Packit d36e9b
	    verstring="$verstring_prefix$major.$iface:$verstring"
Packit d36e9b
	  done
Packit d36e9b
Packit d36e9b
	  # Before this point, $major must not contain `.'.
Packit d36e9b
	  major=.$major
Packit d36e9b
	  versuffix="$major.$revision"
Packit d36e9b
	  ;;
Packit d36e9b
Packit d36e9b
	linux)
Packit d36e9b
	  major=.`expr $current - $age`
Packit d36e9b
	  versuffix="$major.$age.$revision"