Blame ltmain.sh

Packit 8dc392
# Generated from ltmain.m4sh.
Packit 8dc392
Packit 8dc392
# ltmain.sh (GNU libtool) 2.2.6b
Packit 8dc392
# Written by Gordon Matzigkeit <gord@gnu.ai.mit.edu>, 1996
Packit 8dc392
Packit 8dc392
# Copyright (C) 1996, 1997, 1998, 1999, 2000, 2001, 2003, 2004, 2005, 2006, 2007 2008 Free Software Foundation, Inc.
Packit 8dc392
# This is free software; see the source for copying conditions.  There is NO
Packit 8dc392
# warranty; not even for MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
Packit 8dc392
Packit 8dc392
# GNU Libtool is free software; you can redistribute it and/or modify
Packit 8dc392
# it under the terms of the GNU General Public License as published by
Packit 8dc392
# the Free Software Foundation; either version 2 of the License, or
Packit 8dc392
# (at your option) any later version.
Packit 8dc392
#
Packit 8dc392
# As a special exception to the GNU General Public License,
Packit 8dc392
# if you distribute this file as part of a program or library that
Packit 8dc392
# is built using GNU Libtool, you may include this file under the
Packit 8dc392
# same distribution terms that you use for the rest of that program.
Packit 8dc392
#
Packit 8dc392
# GNU Libtool is distributed in the hope that it will be useful, but
Packit 8dc392
# WITHOUT ANY WARRANTY; without even the implied warranty of
Packit 8dc392
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
Packit 8dc392
# General Public License for more details.
Packit 8dc392
#
Packit 8dc392
# You should have received a copy of the GNU General Public License
Packit 8dc392
# along with GNU Libtool; see the file COPYING.  If not, a copy
Packit 8dc392
# can be downloaded from http://www.gnu.org/licenses/gpl.html,
Packit 8dc392
# or obtained by writing to the Free Software Foundation, Inc.,
Packit 8dc392
# 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
Packit 8dc392
Packit 8dc392
# Usage: $progname [OPTION]... [MODE-ARG]...
Packit 8dc392
#
Packit 8dc392
# Provide generalized library-building support services.
Packit 8dc392
#
Packit 8dc392
#     --config             show all configuration variables
Packit 8dc392
#     --debug              enable verbose shell tracing
Packit 8dc392
# -n, --dry-run            display commands without modifying any files
Packit 8dc392
#     --features           display basic configuration information and exit
Packit 8dc392
#     --mode=MODE          use operation mode MODE
Packit 8dc392
#     --preserve-dup-deps  don't remove duplicate dependency libraries
Packit 8dc392
#     --quiet, --silent    don't print informational messages
Packit 8dc392
#     --tag=TAG            use configuration variables from tag TAG
Packit 8dc392
# -v, --verbose            print informational messages (default)
Packit 8dc392
#     --version            print version information
Packit 8dc392
# -h, --help               print short or long help message
Packit 8dc392
#
Packit 8dc392
# MODE must be one of the following:
Packit 8dc392
#
Packit 8dc392
#       clean              remove files from the build directory
Packit 8dc392
#       compile            compile a source file into a libtool object
Packit 8dc392
#       execute            automatically set library path, then run a program
Packit 8dc392
#       finish             complete the installation of libtool libraries
Packit 8dc392
#       install            install libraries or executables
Packit 8dc392
#       link               create a library or an executable
Packit 8dc392
#       uninstall          remove libraries from an installed directory
Packit 8dc392
#
Packit 8dc392
# MODE-ARGS vary depending on the MODE.
Packit 8dc392
# Try `$progname --help --mode=MODE' for a more detailed description of MODE.
Packit 8dc392
#
Packit 8dc392
# When reporting a bug, please describe a test case to reproduce it and
Packit 8dc392
# include the following information:
Packit 8dc392
#
Packit 8dc392
#       host-triplet:	$host
Packit 8dc392
#       shell:		$SHELL
Packit 8dc392
#       compiler:		$LTCC
Packit 8dc392
#       compiler flags:		$LTCFLAGS
Packit 8dc392
#       linker:		$LD (gnu? $with_gnu_ld)
Packit 8dc392
#       $progname:		(GNU libtool) 2.2.6b
Packit 8dc392
#       automake:		$automake_version
Packit 8dc392
#       autoconf:		$autoconf_version
Packit 8dc392
#
Packit 8dc392
# Report bugs to <bug-libtool@gnu.org>.
Packit 8dc392
Packit 8dc392
PROGRAM=ltmain.sh
Packit 8dc392
PACKAGE=libtool
Packit 8dc392
VERSION=2.2.6b
Packit 8dc392
TIMESTAMP=""
Packit 8dc392
package_revision=1.3017
Packit 8dc392
Packit 8dc392
# Be Bourne compatible
Packit 8dc392
if test -n "${ZSH_VERSION+set}" && (emulate sh) >/dev/null 2>&1; then
Packit 8dc392
  emulate sh
Packit 8dc392
  NULLCMD=:
Packit 8dc392
  # Zsh 3.x and 4.x performs word splitting on ${1+"$@"}, which
Packit 8dc392
  # is contrary to our usage.  Disable this feature.
Packit 8dc392
  alias -g '${1+"$@"}'='"$@"'
Packit 8dc392
  setopt NO_GLOB_SUBST
Packit 8dc392
else
Packit 8dc392
  case `(set -o) 2>/dev/null` in *posix*) set -o posix;; esac
Packit 8dc392
fi
Packit 8dc392
BIN_SH=xpg4; export BIN_SH # for Tru64
Packit 8dc392
DUALCASE=1; export DUALCASE # for MKS sh
Packit 8dc392
Packit 8dc392
# NLS nuisances: We save the old values to restore during execute mode.
Packit 8dc392
# Only set LANG and LC_ALL to C if already set.
Packit 8dc392
# These must not be set unconditionally because not all systems understand
Packit 8dc392
# e.g. LANG=C (notably SCO).
Packit 8dc392
lt_user_locale=
Packit 8dc392
lt_safe_locale=
Packit 8dc392
for lt_var in LANG LANGUAGE LC_ALL LC_CTYPE LC_COLLATE LC_MESSAGES
Packit 8dc392
do
Packit 8dc392
  eval "if test \"\${$lt_var+set}\" = set; then
Packit 8dc392
          save_$lt_var=\$$lt_var
Packit 8dc392
          $lt_var=C
Packit 8dc392
	  export $lt_var
Packit 8dc392
	  lt_user_locale=\"$lt_var=\\\$save_\$lt_var; \$lt_user_locale\"
Packit 8dc392
	  lt_safe_locale=\"$lt_var=C; \$lt_safe_locale\"
Packit 8dc392
	fi"
Packit 8dc392
done
Packit 8dc392
Packit 8dc392
$lt_unset CDPATH
Packit 8dc392
Packit 8dc392
Packit 8dc392
Packit 8dc392
Packit 8dc392
Packit 8dc392
: ${CP="cp -f"}
Packit 8dc392
: ${ECHO="echo"}
Packit 8dc392
: ${EGREP="/bin/grep -E"}
Packit 8dc392
: ${FGREP="/bin/grep -F"}
Packit 8dc392
: ${GREP="/bin/grep"}
Packit 8dc392
: ${LN_S="ln -s"}
Packit 8dc392
: ${MAKE="make"}
Packit 8dc392
: ${MKDIR="mkdir"}
Packit 8dc392
: ${MV="mv -f"}
Packit 8dc392
: ${RM="rm -f"}
Packit 8dc392
: ${SED="/bin/sed"}
Packit 8dc392
: ${SHELL="${CONFIG_SHELL-/bin/sh}"}
Packit 8dc392
: ${Xsed="$SED -e 1s/^X//"}
Packit 8dc392
Packit 8dc392
# Global variables:
Packit 8dc392
EXIT_SUCCESS=0
Packit 8dc392
EXIT_FAILURE=1
Packit 8dc392
EXIT_MISMATCH=63  # $? = 63 is used to indicate version mismatch to missing.
Packit 8dc392
EXIT_SKIP=77	  # $? = 77 is used to indicate a skipped test to automake.
Packit 8dc392
Packit 8dc392
exit_status=$EXIT_SUCCESS
Packit 8dc392
Packit 8dc392
# Make sure IFS has a sensible default
Packit 8dc392
lt_nl='
Packit 8dc392
'
Packit 8dc392
IFS=" 	$lt_nl"
Packit 8dc392
Packit 8dc392
dirname="s,/[^/]*$,,"
Packit 8dc392
basename="s,^.*/,,"
Packit 8dc392
Packit 8dc392
# func_dirname_and_basename file append nondir_replacement
Packit 8dc392
# perform func_basename and func_dirname in a single function
Packit 8dc392
# call:
Packit 8dc392
#   dirname:  Compute the dirname of FILE.  If nonempty,
Packit 8dc392
#             add APPEND to the result, otherwise set result
Packit 8dc392
#             to NONDIR_REPLACEMENT.
Packit 8dc392
#             value returned in "$func_dirname_result"
Packit 8dc392
#   basename: Compute filename of FILE.
Packit 8dc392
#             value retuned in "$func_basename_result"
Packit 8dc392
# Implementation must be kept synchronized with func_dirname
Packit 8dc392
# and func_basename. For efficiency, we do not delegate to
Packit 8dc392
# those functions but instead duplicate the functionality here.
Packit 8dc392
func_dirname_and_basename ()
Packit 8dc392
{
Packit 8dc392
  # Extract subdirectory from the argument.
Packit 8dc392
  func_dirname_result=`$ECHO "X${1}" | $Xsed -e "$dirname"`
Packit 8dc392
  if test "X$func_dirname_result" = "X${1}"; then
Packit 8dc392
    func_dirname_result="${3}"
Packit 8dc392
  else
Packit 8dc392
    func_dirname_result="$func_dirname_result${2}"
Packit 8dc392
  fi
Packit 8dc392
  func_basename_result=`$ECHO "X${1}" | $Xsed -e "$basename"`
Packit 8dc392
}
Packit 8dc392
Packit 8dc392
# Generated shell functions inserted here.
Packit 8dc392
Packit 8dc392
# Work around backward compatibility issue on IRIX 6.5. On IRIX 6.4+, sh
Packit 8dc392
# is ksh but when the shell is invoked as "sh" and the current value of
Packit 8dc392
# the _XPG environment variable is not equal to 1 (one), the special
Packit 8dc392
# positional parameter $0, within a function call, is the name of the
Packit 8dc392
# function.
Packit 8dc392
progpath="$0"
Packit 8dc392
Packit 8dc392
# The name of this program:
Packit 8dc392
# In the unlikely event $progname began with a '-', it would play havoc with
Packit 8dc392
# func_echo (imagine progname=-n), so we prepend ./ in that case:
Packit 8dc392
func_dirname_and_basename "$progpath"
Packit 8dc392
progname=$func_basename_result
Packit 8dc392
case $progname in
Packit 8dc392
  -*) progname=./$progname ;;
Packit 8dc392
esac
Packit 8dc392
Packit 8dc392
# Make sure we have an absolute path for reexecution:
Packit 8dc392
case $progpath in
Packit 8dc392
  [\\/]*|[A-Za-z]:\\*) ;;
Packit 8dc392
  *[\\/]*)
Packit 8dc392
     progdir=$func_dirname_result
Packit 8dc392
     progdir=`cd "$progdir" && pwd`
Packit 8dc392
     progpath="$progdir/$progname"
Packit 8dc392
     ;;
Packit 8dc392
  *)
Packit 8dc392
     save_IFS="$IFS"
Packit 8dc392
     IFS=:
Packit 8dc392
     for progdir in $PATH; do
Packit 8dc392
       IFS="$save_IFS"
Packit 8dc392
       test -x "$progdir/$progname" && break
Packit 8dc392
     done
Packit 8dc392
     IFS="$save_IFS"
Packit 8dc392
     test -n "$progdir" || progdir=`pwd`
Packit 8dc392
     progpath="$progdir/$progname"
Packit 8dc392
     ;;
Packit 8dc392
esac
Packit 8dc392
Packit 8dc392
# Sed substitution that helps us do robust quoting.  It backslashifies
Packit 8dc392
# metacharacters that are still active within double-quoted strings.
Packit 8dc392
Xsed="${SED}"' -e 1s/^X//'
Packit 8dc392
sed_quote_subst='s/\([`"$\\]\)/\\\1/g'
Packit 8dc392
Packit 8dc392
# Same as above, but do not quote variable references.
Packit 8dc392
double_quote_subst='s/\(["`\\]\)/\\\1/g'
Packit 8dc392
Packit 8dc392
# Re-`\' parameter expansions in output of double_quote_subst that were
Packit 8dc392
# `\'-ed in input to the same.  If an odd number of `\' preceded a '$'
Packit 8dc392
# in input to double_quote_subst, that '$' was protected from expansion.
Packit 8dc392
# Since each input `\' is now two `\'s, look for any number of runs of
Packit 8dc392
# four `\'s followed by two `\'s and then a '$'.  `\' that '$'.
Packit 8dc392
bs='\\'
Packit 8dc392
bs2='\\\\'
Packit 8dc392
bs4='\\\\\\\\'
Packit 8dc392
dollar='\$'
Packit 8dc392
sed_double_backslash="\
Packit 8dc392
  s/$bs4/&\\
Packit 8dc392
/g
Packit 8dc392
  s/^$bs2$dollar/$bs&/
Packit 8dc392
  s/\\([^$bs]\\)$bs2$dollar/\\1$bs2$bs$dollar/g
Packit 8dc392
  s/\n//g"
Packit 8dc392
Packit 8dc392
# Standard options:
Packit 8dc392
opt_dry_run=false
Packit 8dc392
opt_help=false
Packit 8dc392
opt_quiet=false
Packit 8dc392
opt_verbose=false
Packit 8dc392
opt_warning=:
Packit 8dc392
Packit 8dc392
# func_echo arg...
Packit 8dc392
# Echo program name prefixed message, along with the current mode
Packit 8dc392
# name if it has been set yet.
Packit 8dc392
func_echo ()
Packit 8dc392
{
Packit 8dc392
    $ECHO "$progname${mode+: }$mode: $*"
Packit 8dc392
}
Packit 8dc392
Packit 8dc392
# func_verbose arg...
Packit 8dc392
# Echo program name prefixed message in verbose mode only.
Packit 8dc392
func_verbose ()
Packit 8dc392
{
Packit 8dc392
    $opt_verbose && func_echo ${1+"$@"}
Packit 8dc392
Packit 8dc392
    # A bug in bash halts the script if the last line of a function
Packit 8dc392
    # fails when set -e is in force, so we need another command to
Packit 8dc392
    # work around that:
Packit 8dc392
    :
Packit 8dc392
}
Packit 8dc392
Packit 8dc392
# func_error arg...
Packit 8dc392
# Echo program name prefixed message to standard error.
Packit 8dc392
func_error ()
Packit 8dc392
{
Packit 8dc392
    $ECHO "$progname${mode+: }$mode: "${1+"$@"} 1>&2
Packit 8dc392
}
Packit 8dc392
Packit 8dc392
# func_warning arg...
Packit 8dc392
# Echo program name prefixed warning message to standard error.
Packit 8dc392
func_warning ()
Packit 8dc392
{
Packit 8dc392
    $opt_warning && $ECHO "$progname${mode+: }$mode: warning: "${1+"$@"} 1>&2
Packit 8dc392
Packit 8dc392
    # bash bug again:
Packit 8dc392
    :
Packit 8dc392
}
Packit 8dc392
Packit 8dc392
# func_fatal_error arg...
Packit 8dc392
# Echo program name prefixed message to standard error, and exit.
Packit 8dc392
func_fatal_error ()
Packit 8dc392
{
Packit 8dc392
    func_error ${1+"$@"}
Packit 8dc392
    exit $EXIT_FAILURE
Packit 8dc392
}
Packit 8dc392
Packit 8dc392
# func_fatal_help arg...
Packit 8dc392
# Echo program name prefixed message to standard error, followed by
Packit 8dc392
# a help hint, and exit.
Packit 8dc392
func_fatal_help ()
Packit 8dc392
{
Packit 8dc392
    func_error ${1+"$@"}
Packit 8dc392
    func_fatal_error "$help"
Packit 8dc392
}
Packit 8dc392
help="Try \`$progname --help' for more information."  ## default
Packit 8dc392
Packit 8dc392
Packit 8dc392
# func_grep expression filename
Packit 8dc392
# Check whether EXPRESSION matches any line of FILENAME, without output.
Packit 8dc392
func_grep ()
Packit 8dc392
{
Packit 8dc392
    $GREP "$1" "$2" >/dev/null 2>&1
Packit 8dc392
}
Packit 8dc392
Packit 8dc392
Packit 8dc392
# func_mkdir_p directory-path
Packit 8dc392
# Make sure the entire path to DIRECTORY-PATH is available.
Packit 8dc392
func_mkdir_p ()
Packit 8dc392
{
Packit 8dc392
    my_directory_path="$1"
Packit 8dc392
    my_dir_list=
Packit 8dc392
Packit 8dc392
    if test -n "$my_directory_path" && test "$opt_dry_run" != ":"; then
Packit 8dc392
Packit 8dc392
      # Protect directory names starting with `-'
Packit 8dc392
      case $my_directory_path in
Packit 8dc392
        -*) my_directory_path="./$my_directory_path" ;;
Packit 8dc392
      esac
Packit 8dc392
Packit 8dc392
      # While some portion of DIR does not yet exist...
Packit 8dc392
      while test ! -d "$my_directory_path"; do
Packit 8dc392
        # ...make a list in topmost first order.  Use a colon delimited
Packit 8dc392
	# list incase some portion of path contains whitespace.
Packit 8dc392
        my_dir_list="$my_directory_path:$my_dir_list"
Packit 8dc392
Packit 8dc392
        # If the last portion added has no slash in it, the list is done
Packit 8dc392
        case $my_directory_path in */*) ;; *) break ;; esac
Packit 8dc392
Packit 8dc392
        # ...otherwise throw away the child directory and loop
Packit 8dc392
        my_directory_path=`$ECHO "X$my_directory_path" | $Xsed -e "$dirname"`
Packit 8dc392
      done
Packit 8dc392
      my_dir_list=`$ECHO "X$my_dir_list" | $Xsed -e 's,:*$,,'`
Packit 8dc392
Packit 8dc392
      save_mkdir_p_IFS="$IFS"; IFS=':'
Packit 8dc392
      for my_dir in $my_dir_list; do
Packit 8dc392
	IFS="$save_mkdir_p_IFS"
Packit 8dc392
        # mkdir can fail with a `File exist' error if two processes
Packit 8dc392
        # try to create one of the directories concurrently.  Don't
Packit 8dc392
        # stop in that case!
Packit 8dc392
        $MKDIR "$my_dir" 2>/dev/null || :
Packit 8dc392
      done
Packit 8dc392
      IFS="$save_mkdir_p_IFS"
Packit 8dc392
Packit 8dc392
      # Bail out if we (or some other process) failed to create a directory.
Packit 8dc392
      test -d "$my_directory_path" || \
Packit 8dc392
        func_fatal_error "Failed to create \`$1'"
Packit 8dc392
    fi
Packit 8dc392
}
Packit 8dc392
Packit 8dc392
Packit 8dc392
# func_mktempdir [string]
Packit 8dc392
# Make a temporary directory that won't clash with other running
Packit 8dc392
# libtool processes, and avoids race conditions if possible.  If
Packit 8dc392
# given, STRING is the basename for that directory.
Packit 8dc392
func_mktempdir ()
Packit 8dc392
{
Packit 8dc392
    my_template="${TMPDIR-/tmp}/${1-$progname}"
Packit 8dc392
Packit 8dc392
    if test "$opt_dry_run" = ":"; then
Packit 8dc392
      # Return a directory name, but don't create it in dry-run mode
Packit 8dc392
      my_tmpdir="${my_template}-$$"
Packit 8dc392
    else
Packit 8dc392
Packit 8dc392
      # If mktemp works, use that first and foremost
Packit 8dc392
      my_tmpdir=`mktemp -d "${my_template}-XXXXXXXX" 2>/dev/null`
Packit 8dc392
Packit 8dc392
      if test ! -d "$my_tmpdir"; then
Packit 8dc392
        # Failing that, at least try and use $RANDOM to avoid a race
Packit 8dc392
        my_tmpdir="${my_template}-${RANDOM-0}$$"
Packit 8dc392
Packit 8dc392
        save_mktempdir_umask=`umask`
Packit 8dc392
        umask 0077
Packit 8dc392
        $MKDIR "$my_tmpdir"
Packit 8dc392
        umask $save_mktempdir_umask
Packit 8dc392
      fi
Packit 8dc392
Packit 8dc392
      # If we're not in dry-run mode, bomb out on failure
Packit 8dc392
      test -d "$my_tmpdir" || \
Packit 8dc392
        func_fatal_error "cannot create temporary directory \`$my_tmpdir'"
Packit 8dc392
    fi
Packit 8dc392
Packit 8dc392
    $ECHO "X$my_tmpdir" | $Xsed
Packit 8dc392
}
Packit 8dc392
Packit 8dc392
Packit 8dc392
# func_quote_for_eval arg
Packit 8dc392
# Aesthetically quote ARG to be evaled later.
Packit 8dc392
# This function returns two values: FUNC_QUOTE_FOR_EVAL_RESULT
Packit 8dc392
# is double-quoted, suitable for a subsequent eval, whereas
Packit 8dc392
# FUNC_QUOTE_FOR_EVAL_UNQUOTED_RESULT has merely all characters
Packit 8dc392
# which are still active within double quotes backslashified.
Packit 8dc392
func_quote_for_eval ()
Packit 8dc392
{
Packit 8dc392
    case $1 in
Packit 8dc392
      *[\\\`\"\$]*)
Packit 8dc392
	func_quote_for_eval_unquoted_result=`$ECHO "X$1" | $Xsed -e "$sed_quote_subst"` ;;
Packit 8dc392
      *)
Packit 8dc392
        func_quote_for_eval_unquoted_result="$1" ;;
Packit 8dc392
    esac
Packit 8dc392
Packit 8dc392
    case $func_quote_for_eval_unquoted_result in
Packit 8dc392
      # Double-quote args containing shell metacharacters to delay
Packit 8dc392
      # word splitting, command substitution and and variable
Packit 8dc392
      # expansion for a subsequent eval.
Packit 8dc392
      # Many Bourne shells cannot handle close brackets correctly
Packit 8dc392
      # in scan sets, so we specify it separately.
Packit 8dc392
      *[\[\~\#\^\&\*\(\)\{\}\|\;\<\>\?\'\ \	]*|*]*|"")
Packit 8dc392
        func_quote_for_eval_result="\"$func_quote_for_eval_unquoted_result\""
Packit 8dc392
        ;;
Packit 8dc392
      *)
Packit 8dc392
        func_quote_for_eval_result="$func_quote_for_eval_unquoted_result"
Packit 8dc392
    esac
Packit 8dc392
}
Packit 8dc392
Packit 8dc392
Packit 8dc392
# func_quote_for_expand arg
Packit 8dc392
# Aesthetically quote ARG to be evaled later; same as above,
Packit 8dc392
# but do not quote variable references.
Packit 8dc392
func_quote_for_expand ()
Packit 8dc392
{
Packit 8dc392
    case $1 in
Packit 8dc392
      *[\\\`\"]*)
Packit 8dc392
	my_arg=`$ECHO "X$1" | $Xsed \
Packit 8dc392
	    -e "$double_quote_subst" -e "$sed_double_backslash"` ;;
Packit 8dc392
      *)
Packit 8dc392
        my_arg="$1" ;;
Packit 8dc392
    esac
Packit 8dc392
Packit 8dc392
    case $my_arg in
Packit 8dc392
      # Double-quote args containing shell metacharacters to delay
Packit 8dc392
      # word splitting and command substitution for a subsequent eval.
Packit 8dc392
      # Many Bourne shells cannot handle close brackets correctly
Packit 8dc392
      # in scan sets, so we specify it separately.
Packit 8dc392
      *[\[\~\#\^\&\*\(\)\{\}\|\;\<\>\?\'\ \	]*|*]*|"")
Packit 8dc392
        my_arg="\"$my_arg\""
Packit 8dc392
        ;;
Packit 8dc392
    esac
Packit 8dc392
Packit 8dc392
    func_quote_for_expand_result="$my_arg"
Packit 8dc392
}
Packit 8dc392
Packit 8dc392
Packit 8dc392
# func_show_eval cmd [fail_exp]
Packit 8dc392
# Unless opt_silent is true, then output CMD.  Then, if opt_dryrun is
Packit 8dc392
# not true, evaluate CMD.  If the evaluation of CMD fails, and FAIL_EXP
Packit 8dc392
# is given, then evaluate it.
Packit 8dc392
func_show_eval ()
Packit 8dc392
{
Packit 8dc392
    my_cmd="$1"
Packit 8dc392
    my_fail_exp="${2-:}"
Packit 8dc392
Packit 8dc392
    ${opt_silent-false} || {
Packit 8dc392
      func_quote_for_expand "$my_cmd"
Packit 8dc392
      eval "func_echo $func_quote_for_expand_result"
Packit 8dc392
    }
Packit 8dc392
Packit 8dc392
    if ${opt_dry_run-false}; then :; else
Packit 8dc392
      eval "$my_cmd"
Packit 8dc392
      my_status=$?
Packit 8dc392
      if test "$my_status" -eq 0; then :; else
Packit 8dc392
	eval "(exit $my_status); $my_fail_exp"
Packit 8dc392
      fi
Packit 8dc392
    fi
Packit 8dc392
}
Packit 8dc392
Packit 8dc392
Packit 8dc392
# func_show_eval_locale cmd [fail_exp]
Packit 8dc392
# Unless opt_silent is true, then output CMD.  Then, if opt_dryrun is
Packit 8dc392
# not true, evaluate CMD.  If the evaluation of CMD fails, and FAIL_EXP
Packit 8dc392
# is given, then evaluate it.  Use the saved locale for evaluation.
Packit 8dc392
func_show_eval_locale ()
Packit 8dc392
{
Packit 8dc392
    my_cmd="$1"
Packit 8dc392
    my_fail_exp="${2-:}"
Packit 8dc392
Packit 8dc392
    ${opt_silent-false} || {
Packit 8dc392
      func_quote_for_expand "$my_cmd"
Packit 8dc392
      eval "func_echo $func_quote_for_expand_result"
Packit 8dc392
    }
Packit 8dc392
Packit 8dc392
    if ${opt_dry_run-false}; then :; else
Packit 8dc392
      eval "$lt_user_locale
Packit 8dc392
	    $my_cmd"
Packit 8dc392
      my_status=$?
Packit 8dc392
      eval "$lt_safe_locale"
Packit 8dc392
      if test "$my_status" -eq 0; then :; else
Packit 8dc392
	eval "(exit $my_status); $my_fail_exp"
Packit 8dc392
      fi
Packit 8dc392
    fi
Packit 8dc392
}
Packit 8dc392
Packit 8dc392
Packit 8dc392
Packit 8dc392
Packit 8dc392
Packit 8dc392
# func_version
Packit 8dc392
# Echo version message to standard output and exit.
Packit 8dc392
func_version ()
Packit 8dc392
{
Packit 8dc392
    $SED -n '/^# '$PROGRAM' (GNU /,/# warranty; / {
Packit 8dc392
        s/^# //
Packit 8dc392
	s/^# *$//
Packit 8dc392
        s/\((C)\)[ 0-9,-]*\( [1-9][0-9]*\)/\1\2/
Packit 8dc392
        p
Packit 8dc392
     }' < "$progpath"
Packit 8dc392
     exit $?
Packit 8dc392
}
Packit 8dc392
Packit 8dc392
# func_usage
Packit 8dc392
# Echo short help message to standard output and exit.
Packit 8dc392
func_usage ()
Packit 8dc392
{
Packit 8dc392
    $SED -n '/^# Usage:/,/# -h/ {
Packit 8dc392
        s/^# //
Packit 8dc392
	s/^# *$//
Packit 8dc392
	s/\$progname/'$progname'/
Packit 8dc392
	p
Packit 8dc392
    }' < "$progpath"
Packit 8dc392
    $ECHO
Packit 8dc392
    $ECHO "run \`$progname --help | more' for full usage"
Packit 8dc392
    exit $?
Packit 8dc392
}
Packit 8dc392
Packit 8dc392
# func_help
Packit 8dc392
# Echo long help message to standard output and exit.
Packit 8dc392
func_help ()
Packit 8dc392
{
Packit 8dc392
    $SED -n '/^# Usage:/,/# Report bugs to/ {
Packit 8dc392
        s/^# //
Packit 8dc392
	s/^# *$//
Packit 8dc392
	s*\$progname*'$progname'*
Packit 8dc392
	s*\$host*'"$host"'*
Packit 8dc392
	s*\$SHELL*'"$SHELL"'*
Packit 8dc392
	s*\$LTCC*'"$LTCC"'*
Packit 8dc392
	s*\$LTCFLAGS*'"$LTCFLAGS"'*
Packit 8dc392
	s*\$LD*'"$LD"'*
Packit 8dc392
	s/\$with_gnu_ld/'"$with_gnu_ld"'/
Packit 8dc392
	s/\$automake_version/'"`(automake --version) 2>/dev/null |$SED 1q`"'/
Packit 8dc392
	s/\$autoconf_version/'"`(autoconf --version) 2>/dev/null |$SED 1q`"'/
Packit 8dc392
	p
Packit 8dc392
     }' < "$progpath"
Packit 8dc392
    exit $?
Packit 8dc392
}
Packit 8dc392
Packit 8dc392
# func_missing_arg argname
Packit 8dc392
# Echo program name prefixed message to standard error and set global
Packit 8dc392
# exit_cmd.
Packit 8dc392
func_missing_arg ()
Packit 8dc392
{
Packit 8dc392
    func_error "missing argument for $1"
Packit 8dc392
    exit_cmd=exit
Packit 8dc392
}
Packit 8dc392
Packit 8dc392
exit_cmd=:
Packit 8dc392
Packit 8dc392
Packit 8dc392
Packit 8dc392
Packit 8dc392
Packit 8dc392
# Check that we have a working $ECHO.
Packit 8dc392
if test "X$1" = X--no-reexec; then
Packit 8dc392
  # Discard the --no-reexec flag, and continue.
Packit 8dc392
  shift
Packit 8dc392
elif test "X$1" = X--fallback-echo; then
Packit 8dc392
  # Avoid inline document here, it may be left over
Packit 8dc392
  :
Packit 8dc392
elif test "X`{ $ECHO '\t'; } 2>/dev/null`" = 'X\t'; then
Packit 8dc392
  # Yippee, $ECHO works!
Packit 8dc392
  :
Packit 8dc392
else
Packit 8dc392
  # Restart under the correct shell, and then maybe $ECHO will work.
Packit 8dc392
  exec $SHELL "$progpath" --no-reexec ${1+"$@"}
Packit 8dc392
fi
Packit 8dc392
Packit 8dc392
if test "X$1" = X--fallback-echo; then
Packit 8dc392
  # used as fallback echo
Packit 8dc392
  shift
Packit 8dc392
  cat <
Packit 8dc392
$*
Packit 8dc392
EOF
Packit 8dc392
  exit $EXIT_SUCCESS
Packit 8dc392
fi
Packit 8dc392
Packit 8dc392
magic="%%%MAGIC variable%%%"
Packit 8dc392
magic_exe="%%%MAGIC EXE variable%%%"
Packit 8dc392
Packit 8dc392
# Global variables.
Packit 8dc392
# $mode is unset
Packit 8dc392
nonopt=
Packit 8dc392
execute_dlfiles=
Packit 8dc392
preserve_args=
Packit 8dc392
lo2o="s/\\.lo\$/.${objext}/"
Packit 8dc392
o2lo="s/\\.${objext}\$/.lo/"
Packit 8dc392
extracted_archives=
Packit 8dc392
extracted_serial=0
Packit 8dc392
Packit 8dc392
opt_dry_run=false
Packit 8dc392
opt_duplicate_deps=false
Packit 8dc392
opt_silent=false
Packit 8dc392
opt_debug=:
Packit 8dc392
Packit 8dc392
# If this variable is set in any of the actions, the command in it
Packit 8dc392
# will be execed at the end.  This prevents here-documents from being
Packit 8dc392
# left over by shells.
Packit 8dc392
exec_cmd=
Packit 8dc392
Packit 8dc392
# func_fatal_configuration arg...
Packit 8dc392
# Echo program name prefixed message to standard error, followed by
Packit 8dc392
# a configuration failure hint, and exit.
Packit 8dc392
func_fatal_configuration ()
Packit 8dc392
{
Packit 8dc392
    func_error ${1+"$@"}
Packit 8dc392
    func_error "See the $PACKAGE documentation for more information."
Packit 8dc392
    func_fatal_error "Fatal configuration error."
Packit 8dc392
}
Packit 8dc392
Packit 8dc392
Packit 8dc392
# func_config
Packit 8dc392
# Display the configuration for all the tags in this script.
Packit 8dc392
func_config ()
Packit 8dc392
{
Packit 8dc392
    re_begincf='^# ### BEGIN LIBTOOL'
Packit 8dc392
    re_endcf='^# ### END LIBTOOL'
Packit 8dc392
Packit 8dc392
    # Default configuration.
Packit 8dc392
    $SED "1,/$re_begincf CONFIG/d;/$re_endcf CONFIG/,\$d" < "$progpath"
Packit 8dc392
Packit 8dc392
    # Now print the configurations for the tags.
Packit 8dc392
    for tagname in $taglist; do
Packit 8dc392
      $SED -n "/$re_begincf TAG CONFIG: $tagname\$/,/$re_endcf TAG CONFIG: $tagname\$/p" < "$progpath"
Packit 8dc392
    done
Packit 8dc392
Packit 8dc392
    exit $?
Packit 8dc392
}
Packit 8dc392
Packit 8dc392
# func_features
Packit 8dc392
# Display the features supported by this script.
Packit 8dc392
func_features ()
Packit 8dc392
{
Packit 8dc392
    $ECHO "host: $host"
Packit 8dc392
    if test "$build_libtool_libs" = yes; then
Packit 8dc392
      $ECHO "enable shared libraries"
Packit 8dc392
    else
Packit 8dc392
      $ECHO "disable shared libraries"
Packit 8dc392
    fi
Packit 8dc392
    if test "$build_old_libs" = yes; then
Packit 8dc392
      $ECHO "enable static libraries"
Packit 8dc392
    else
Packit 8dc392
      $ECHO "disable static libraries"
Packit 8dc392
    fi
Packit 8dc392
Packit 8dc392
    exit $?
Packit 8dc392
}
Packit 8dc392
Packit 8dc392
# func_enable_tag tagname
Packit 8dc392
# Verify that TAGNAME is valid, and either flag an error and exit, or
Packit 8dc392
# enable the TAGNAME tag.  We also add TAGNAME to the global $taglist
Packit 8dc392
# variable here.
Packit 8dc392
func_enable_tag ()
Packit 8dc392
{
Packit 8dc392
  # Global variable:
Packit 8dc392
  tagname="$1"
Packit 8dc392
Packit 8dc392
  re_begincf="^# ### BEGIN LIBTOOL TAG CONFIG: $tagname\$"
Packit 8dc392
  re_endcf="^# ### END LIBTOOL TAG CONFIG: $tagname\$"
Packit 8dc392
  sed_extractcf="/$re_begincf/,/$re_endcf/p"
Packit 8dc392
Packit 8dc392
  # Validate tagname.
Packit 8dc392
  case $tagname in
Packit 8dc392
    *[!-_A-Za-z0-9,/]*)
Packit 8dc392
      func_fatal_error "invalid tag name: $tagname"
Packit 8dc392
      ;;
Packit 8dc392
  esac
Packit 8dc392
Packit 8dc392
  # Don't test for the "default" C tag, as we know it's
Packit 8dc392
  # there but not specially marked.
Packit 8dc392
  case $tagname in
Packit 8dc392
    CC) ;;
Packit 8dc392
    *)
Packit 8dc392
      if $GREP "$re_begincf" "$progpath" >/dev/null 2>&1; then
Packit 8dc392
	taglist="$taglist $tagname"
Packit 8dc392
Packit 8dc392
	# Evaluate the configuration.  Be careful to quote the path
Packit 8dc392
	# and the sed script, to avoid splitting on whitespace, but
Packit 8dc392
	# also don't use non-portable quotes within backquotes within
Packit 8dc392
	# quotes we have to do it in 2 steps:
Packit 8dc392
	extractedcf=`$SED -n -e "$sed_extractcf" < "$progpath"`
Packit 8dc392
	eval "$extractedcf"
Packit 8dc392
      else
Packit 8dc392
	func_error "ignoring unknown tag $tagname"
Packit 8dc392
      fi
Packit 8dc392
      ;;
Packit 8dc392
  esac
Packit 8dc392
}
Packit 8dc392
Packit 8dc392
# Parse options once, thoroughly.  This comes as soon as possible in
Packit 8dc392
# the script to make things like `libtool --version' happen quickly.
Packit 8dc392
{
Packit 8dc392
Packit 8dc392
  # Shorthand for --mode=foo, only valid as the first argument
Packit 8dc392
  case $1 in
Packit 8dc392
  clean|clea|cle|cl)
Packit 8dc392
    shift; set dummy --mode clean ${1+"$@"}; shift
Packit 8dc392
    ;;
Packit 8dc392
  compile|compil|compi|comp|com|co|c)
Packit 8dc392
    shift; set dummy --mode compile ${1+"$@"}; shift
Packit 8dc392
    ;;
Packit 8dc392
  execute|execut|execu|exec|exe|ex|e)
Packit 8dc392
    shift; set dummy --mode execute ${1+"$@"}; shift
Packit 8dc392
    ;;
Packit 8dc392
  finish|finis|fini|fin|fi|f)
Packit 8dc392
    shift; set dummy --mode finish ${1+"$@"}; shift
Packit 8dc392
    ;;
Packit 8dc392
  install|instal|insta|inst|ins|in|i)
Packit 8dc392
    shift; set dummy --mode install ${1+"$@"}; shift
Packit 8dc392
    ;;
Packit 8dc392
  link|lin|li|l)
Packit 8dc392
    shift; set dummy --mode link ${1+"$@"}; shift
Packit 8dc392
    ;;
Packit 8dc392
  uninstall|uninstal|uninsta|uninst|unins|unin|uni|un|u)
Packit 8dc392
    shift; set dummy --mode uninstall ${1+"$@"}; shift
Packit 8dc392
    ;;
Packit 8dc392
  esac
Packit 8dc392
Packit 8dc392
  # Parse non-mode specific arguments:
Packit 8dc392
  while test "$#" -gt 0; do
Packit 8dc392
    opt="$1"
Packit 8dc392
    shift
Packit 8dc392
Packit 8dc392
    case $opt in
Packit 8dc392
      --config)		func_config					;;
Packit 8dc392
Packit 8dc392
      --debug)		preserve_args="$preserve_args $opt"
Packit 8dc392
			func_echo "enabling shell trace mode"
Packit 8dc392
			opt_debug='set -x'
Packit 8dc392
			$opt_debug
Packit 8dc392
			;;
Packit 8dc392
Packit 8dc392
      -dlopen)		test "$#" -eq 0 && func_missing_arg "$opt" && break
Packit 8dc392
			execute_dlfiles="$execute_dlfiles $1"
Packit 8dc392
			shift
Packit 8dc392
			;;
Packit 8dc392
Packit 8dc392
      --dry-run | -n)	opt_dry_run=:					;;
Packit 8dc392
      --features)       func_features					;;
Packit 8dc392
      --finish)		mode="finish"					;;
Packit 8dc392
Packit 8dc392
      --mode)		test "$#" -eq 0 && func_missing_arg "$opt" && break
Packit 8dc392
			case $1 in
Packit 8dc392
			  # Valid mode arguments:
Packit 8dc392
			  clean)	;;
Packit 8dc392
			  compile)	;;
Packit 8dc392
			  execute)	;;
Packit 8dc392
			  finish)	;;
Packit 8dc392
			  install)	;;
Packit 8dc392
			  link)		;;
Packit 8dc392
			  relink)	;;
Packit 8dc392
			  uninstall)	;;
Packit 8dc392
Packit 8dc392
			  # Catch anything else as an error
Packit 8dc392
			  *) func_error "invalid argument for $opt"
Packit 8dc392
			     exit_cmd=exit
Packit 8dc392
			     break
Packit 8dc392
			     ;;
Packit 8dc392
		        esac
Packit 8dc392
Packit 8dc392
			mode="$1"
Packit 8dc392
			shift
Packit 8dc392
			;;
Packit 8dc392
Packit 8dc392
      --preserve-dup-deps)
Packit 8dc392
			opt_duplicate_deps=:				;;
Packit 8dc392
Packit 8dc392
      --quiet|--silent)	preserve_args="$preserve_args $opt"
Packit 8dc392
			opt_silent=:
Packit 8dc392
			;;
Packit 8dc392
Packit 8dc392
      --verbose| -v)	preserve_args="$preserve_args $opt"
Packit 8dc392
			opt_silent=false
Packit 8dc392
			;;
Packit 8dc392
Packit 8dc392
      --tag)		test "$#" -eq 0 && func_missing_arg "$opt" && break
Packit 8dc392
			preserve_args="$preserve_args $opt $1"
Packit 8dc392
			func_enable_tag "$1"	# tagname is set here
Packit 8dc392
			shift
Packit 8dc392
			;;
Packit 8dc392
Packit 8dc392
      # Separate optargs to long options:
Packit 8dc392
      -dlopen=*|--mode=*|--tag=*)
Packit 8dc392
			func_opt_split "$opt"
Packit 8dc392
			set dummy "$func_opt_split_opt" "$func_opt_split_arg" ${1+"$@"}
Packit 8dc392
			shift
Packit 8dc392
			;;
Packit 8dc392
Packit 8dc392
      -\?|-h)		func_usage					;;
Packit 8dc392
      --help)		opt_help=:					;;
Packit 8dc392
      --version)	func_version					;;
Packit 8dc392
Packit 8dc392
      -*)		func_fatal_help "unrecognized option \`$opt'"	;;
Packit 8dc392
Packit 8dc392
      *)		nonopt="$opt"
Packit 8dc392
			break
Packit 8dc392
			;;
Packit 8dc392
    esac
Packit 8dc392
  done
Packit 8dc392
Packit 8dc392
Packit 8dc392
  case $host in
Packit 8dc392
    *cygwin* | *mingw* | *pw32* | *cegcc*)
Packit 8dc392
      # don't eliminate duplications in $postdeps and $predeps
Packit 8dc392
      opt_duplicate_compiler_generated_deps=:
Packit 8dc392
      ;;
Packit 8dc392
    *)
Packit 8dc392
      opt_duplicate_compiler_generated_deps=$opt_duplicate_deps
Packit 8dc392
      ;;
Packit 8dc392
  esac
Packit 8dc392
Packit 8dc392
  # Having warned about all mis-specified options, bail out if
Packit 8dc392
  # anything was wrong.
Packit 8dc392
  $exit_cmd $EXIT_FAILURE
Packit 8dc392
}
Packit 8dc392
Packit 8dc392
# func_check_version_match
Packit 8dc392
# Ensure that we are using m4 macros, and libtool script from the same
Packit 8dc392
# release of libtool.
Packit 8dc392
func_check_version_match ()
Packit 8dc392
{
Packit 8dc392
  if test "$package_revision" != "$macro_revision"; then
Packit 8dc392
    if test "$VERSION" != "$macro_version"; then
Packit 8dc392
      if test -z "$macro_version"; then
Packit 8dc392
        cat >&2 <<_LT_EOF
Packit 8dc392
$progname: Version mismatch error.  This is $PACKAGE $VERSION, but the
Packit 8dc392
$progname: definition of this LT_INIT comes from an older release.
Packit 8dc392
$progname: You should recreate aclocal.m4 with macros from $PACKAGE $VERSION
Packit 8dc392
$progname: and run autoconf again.
Packit 8dc392
_LT_EOF
Packit 8dc392
      else
Packit 8dc392
        cat >&2 <<_LT_EOF
Packit 8dc392
$progname: Version mismatch error.  This is $PACKAGE $VERSION, but the
Packit 8dc392
$progname: definition of this LT_INIT comes from $PACKAGE $macro_version.
Packit 8dc392
$progname: You should recreate aclocal.m4 with macros from $PACKAGE $VERSION
Packit 8dc392
$progname: and run autoconf again.
Packit 8dc392
_LT_EOF
Packit 8dc392
      fi
Packit 8dc392
    else
Packit 8dc392
      cat >&2 <<_LT_EOF
Packit 8dc392
$progname: Version mismatch error.  This is $PACKAGE $VERSION, revision $package_revision,
Packit 8dc392
$progname: but the definition of this LT_INIT comes from revision $macro_revision.
Packit 8dc392
$progname: You should recreate aclocal.m4 with macros from revision $package_revision
Packit 8dc392
$progname: of $PACKAGE $VERSION and run autoconf again.
Packit 8dc392
_LT_EOF
Packit 8dc392
    fi
Packit 8dc392
Packit 8dc392
    exit $EXIT_MISMATCH
Packit 8dc392
  fi
Packit 8dc392
}
Packit 8dc392
Packit 8dc392
Packit 8dc392
## ----------- ##
Packit 8dc392
##    Main.    ##
Packit 8dc392
## ----------- ##
Packit 8dc392
Packit 8dc392
$opt_help || {
Packit 8dc392
  # Sanity checks first:
Packit 8dc392
  func_check_version_match
Packit 8dc392
Packit 8dc392
  if test "$build_libtool_libs" != yes && test "$build_old_libs" != yes; then
Packit 8dc392
    func_fatal_configuration "not configured to build any kind of library"
Packit 8dc392
  fi
Packit 8dc392
Packit 8dc392
  test -z "$mode" && func_fatal_error "error: you must specify a MODE."
Packit 8dc392
Packit 8dc392
Packit 8dc392
  # Darwin sucks
Packit 8dc392
  eval std_shrext=\"$shrext_cmds\"
Packit 8dc392
Packit 8dc392
Packit 8dc392
  # Only execute mode is allowed to have -dlopen flags.
Packit 8dc392
  if test -n "$execute_dlfiles" && test "$mode" != execute; then
Packit 8dc392
    func_error "unrecognized option \`-dlopen'"
Packit 8dc392
    $ECHO "$help" 1>&2
Packit 8dc392
    exit $EXIT_FAILURE
Packit 8dc392
  fi
Packit 8dc392
Packit 8dc392
  # Change the help message to a mode-specific one.
Packit 8dc392
  generic_help="$help"
Packit 8dc392
  help="Try \`$progname --help --mode=$mode' for more information."
Packit 8dc392
}
Packit 8dc392
Packit 8dc392
Packit 8dc392
# func_lalib_p file
Packit 8dc392
# True iff FILE is a libtool `.la' library or `.lo' object file.
Packit 8dc392
# This function is only a basic sanity check; it will hardly flush out
Packit 8dc392
# determined imposters.
Packit 8dc392
func_lalib_p ()
Packit 8dc392
{
Packit 8dc392
    test -f "$1" &&
Packit 8dc392
      $SED -e 4q "$1" 2>/dev/null \
Packit 8dc392
        | $GREP "^# Generated by .*$PACKAGE" > /dev/null 2>&1
Packit 8dc392
}
Packit 8dc392
Packit 8dc392
# func_lalib_unsafe_p file
Packit 8dc392
# True iff FILE is a libtool `.la' library or `.lo' object file.
Packit 8dc392
# This function implements the same check as func_lalib_p without
Packit 8dc392
# resorting to external programs.  To this end, it redirects stdin and
Packit 8dc392
# closes it afterwards, without saving the original file descriptor.
Packit 8dc392
# As a safety measure, use it only where a negative result would be
Packit 8dc392
# fatal anyway.  Works if `file' does not exist.
Packit 8dc392
func_lalib_unsafe_p ()
Packit 8dc392
{
Packit 8dc392
    lalib_p=no
Packit 8dc392
    if test -f "$1" && test -r "$1" && exec 5<&0 <"$1"; then
Packit 8dc392
	for lalib_p_l in 1 2 3 4
Packit 8dc392
	do
Packit 8dc392
	    read lalib_p_line
Packit 8dc392
	    case "$lalib_p_line" in
Packit 8dc392
		\#\ Generated\ by\ *$PACKAGE* ) lalib_p=yes; break;;
Packit 8dc392
	    esac
Packit 8dc392
	done
Packit 8dc392
	exec 0<&5 5<&-
Packit 8dc392
    fi
Packit 8dc392
    test "$lalib_p" = yes
Packit 8dc392
}
Packit 8dc392
Packit 8dc392
# func_ltwrapper_script_p file
Packit 8dc392
# True iff FILE is a libtool wrapper script
Packit 8dc392
# This function is only a basic sanity check; it will hardly flush out
Packit 8dc392
# determined imposters.
Packit 8dc392
func_ltwrapper_script_p ()
Packit 8dc392
{
Packit 8dc392
    func_lalib_p "$1"
Packit 8dc392
}
Packit 8dc392
Packit 8dc392
# func_ltwrapper_executable_p file
Packit 8dc392
# True iff FILE is a libtool wrapper executable
Packit 8dc392
# This function is only a basic sanity check; it will hardly flush out
Packit 8dc392
# determined imposters.
Packit 8dc392
func_ltwrapper_executable_p ()
Packit 8dc392
{
Packit 8dc392
    func_ltwrapper_exec_suffix=
Packit 8dc392
    case $1 in
Packit 8dc392
    *.exe) ;;
Packit 8dc392
    *) func_ltwrapper_exec_suffix=.exe ;;
Packit 8dc392
    esac
Packit 8dc392
    $GREP "$magic_exe" "$1$func_ltwrapper_exec_suffix" >/dev/null 2>&1
Packit 8dc392
}
Packit 8dc392
Packit 8dc392
# func_ltwrapper_scriptname file
Packit 8dc392
# Assumes file is an ltwrapper_executable
Packit 8dc392
# uses $file to determine the appropriate filename for a
Packit 8dc392
# temporary ltwrapper_script.
Packit 8dc392
func_ltwrapper_scriptname ()
Packit 8dc392
{
Packit 8dc392
    func_ltwrapper_scriptname_result=""
Packit 8dc392
    if func_ltwrapper_executable_p "$1"; then
Packit 8dc392
	func_dirname_and_basename "$1" "" "."
Packit 8dc392
	func_stripname '' '.exe' "$func_basename_result"
Packit 8dc392
	func_ltwrapper_scriptname_result="$func_dirname_result/$objdir/${func_stripname_result}_ltshwrapper"
Packit 8dc392
    fi
Packit 8dc392
}
Packit 8dc392
Packit 8dc392
# func_ltwrapper_p file
Packit 8dc392
# True iff FILE is a libtool wrapper script or wrapper executable
Packit 8dc392
# This function is only a basic sanity check; it will hardly flush out
Packit 8dc392
# determined imposters.
Packit 8dc392
func_ltwrapper_p ()
Packit 8dc392
{
Packit 8dc392
    func_ltwrapper_script_p "$1" || func_ltwrapper_executable_p "$1"
Packit 8dc392
}
Packit 8dc392
Packit 8dc392
Packit 8dc392
# func_execute_cmds commands fail_cmd
Packit 8dc392
# Execute tilde-delimited COMMANDS.
Packit 8dc392
# If FAIL_CMD is given, eval that upon failure.
Packit 8dc392
# FAIL_CMD may read-access the current command in variable CMD!
Packit 8dc392
func_execute_cmds ()
Packit 8dc392
{
Packit 8dc392
    $opt_debug
Packit 8dc392
    save_ifs=$IFS; IFS='~'
Packit 8dc392
    for cmd in $1; do
Packit 8dc392
      IFS=$save_ifs
Packit 8dc392
      eval cmd=\"$cmd\"
Packit 8dc392
      func_show_eval "$cmd" "${2-:}"
Packit 8dc392
    done
Packit 8dc392
    IFS=$save_ifs
Packit 8dc392
}
Packit 8dc392
Packit 8dc392
Packit 8dc392
# func_source file
Packit 8dc392
# Source FILE, adding directory component if necessary.
Packit 8dc392
# Note that it is not necessary on cygwin/mingw to append a dot to
Packit 8dc392
# FILE even if both FILE and FILE.exe exist: automatic-append-.exe
Packit 8dc392
# behavior happens only for exec(3), not for open(2)!  Also, sourcing
Packit 8dc392
# `FILE.' does not work on cygwin managed mounts.
Packit 8dc392
func_source ()
Packit 8dc392
{
Packit 8dc392
    $opt_debug
Packit 8dc392
    case $1 in
Packit 8dc392
    */* | *\\*)	. "$1" ;;
Packit 8dc392
    *)		. "./$1" ;;
Packit 8dc392
    esac
Packit 8dc392
}
Packit 8dc392
Packit 8dc392
Packit 8dc392
# func_infer_tag arg
Packit 8dc392
# Infer tagged configuration to use if any are available and
Packit 8dc392
# if one wasn't chosen via the "--tag" command line option.
Packit 8dc392
# Only attempt this if the compiler in the base compile
Packit 8dc392
# command doesn't match the default compiler.
Packit 8dc392
# arg is usually of the form 'gcc ...'
Packit 8dc392
func_infer_tag ()
Packit 8dc392
{
Packit 8dc392
    $opt_debug
Packit 8dc392
    if test -n "$available_tags" && test -z "$tagname"; then
Packit 8dc392
      CC_quoted=
Packit 8dc392
      for arg in $CC; do
Packit 8dc392
        func_quote_for_eval "$arg"
Packit 8dc392
	CC_quoted="$CC_quoted $func_quote_for_eval_result"
Packit 8dc392
      done
Packit 8dc392
      case $@ in
Packit 8dc392
      # Blanks in the command may have been stripped by the calling shell,
Packit 8dc392
      # but not from the CC environment variable when configure was run.
Packit 8dc392
      " $CC "* | "$CC "* | " `$ECHO $CC` "* | "`$ECHO $CC` "* | " $CC_quoted"* | "$CC_quoted "* | " `$ECHO $CC_quoted` "* | "`$ECHO $CC_quoted` "*) ;;
Packit 8dc392
      # Blanks at the start of $base_compile will cause this to fail
Packit 8dc392
      # if we don't check for them as well.
Packit 8dc392
      *)
Packit 8dc392
	for z in $available_tags; do
Packit 8dc392
	  if $GREP "^# ### BEGIN LIBTOOL TAG CONFIG: $z$" < "$progpath" > /dev/null; then
Packit 8dc392
	    # Evaluate the configuration.
Packit 8dc392
	    eval "`${SED} -n -e '/^# ### BEGIN LIBTOOL TAG CONFIG: '$z'$/,/^# ### END LIBTOOL TAG CONFIG: '$z'$/p' < $progpath`"
Packit 8dc392
	    CC_quoted=
Packit 8dc392
	    for arg in $CC; do
Packit 8dc392
	      # Double-quote args containing other shell metacharacters.
Packit 8dc392
	      func_quote_for_eval "$arg"
Packit 8dc392
	      CC_quoted="$CC_quoted $func_quote_for_eval_result"
Packit 8dc392
	    done
Packit 8dc392
	    case "$@ " in
Packit 8dc392
	      " $CC "* | "$CC "* | " `$ECHO $CC` "* | "`$ECHO $CC` "* | " $CC_quoted"* | "$CC_quoted "* | " `$ECHO $CC_quoted` "* | "`$ECHO $CC_quoted` "*)
Packit 8dc392
	      # The compiler in the base compile command matches
Packit 8dc392
	      # the one in the tagged configuration.
Packit 8dc392
	      # Assume this is the tagged configuration we want.
Packit 8dc392
	      tagname=$z
Packit 8dc392
	      break
Packit 8dc392
	      ;;
Packit 8dc392
	    esac
Packit 8dc392
	  fi
Packit 8dc392
	done
Packit 8dc392
	# If $tagname still isn't set, then no tagged configuration
Packit 8dc392
	# was found and let the user know that the "--tag" command
Packit 8dc392
	# line option must be used.
Packit 8dc392
	if test -z "$tagname"; then
Packit 8dc392
	  func_echo "unable to infer tagged configuration"
Packit 8dc392
	  func_fatal_error "specify a tag with \`--tag'"
Packit 8dc392
#	else
Packit 8dc392
#	  func_verbose "using $tagname tagged configuration"
Packit 8dc392
	fi
Packit 8dc392
	;;
Packit 8dc392
      esac
Packit 8dc392
    fi
Packit 8dc392
}
Packit 8dc392
Packit 8dc392
Packit 8dc392
Packit 8dc392
# func_write_libtool_object output_name pic_name nonpic_name
Packit 8dc392
# Create a libtool object file (analogous to a ".la" file),
Packit 8dc392
# but don't create it if we're doing a dry run.
Packit 8dc392
func_write_libtool_object ()
Packit 8dc392
{
Packit 8dc392
    write_libobj=${1}
Packit 8dc392
    if test "$build_libtool_libs" = yes; then
Packit 8dc392
      write_lobj=\'${2}\'
Packit 8dc392
    else
Packit 8dc392
      write_lobj=none
Packit 8dc392
    fi
Packit 8dc392
Packit 8dc392
    if test "$build_old_libs" = yes; then
Packit 8dc392
      write_oldobj=\'${3}\'
Packit 8dc392
    else
Packit 8dc392
      write_oldobj=none
Packit 8dc392
    fi
Packit 8dc392
Packit 8dc392
    $opt_dry_run || {
Packit 8dc392
      cat >${write_libobj}T <
Packit 8dc392
# $write_libobj - a libtool object file
Packit 8dc392
# Generated by $PROGRAM (GNU $PACKAGE$TIMESTAMP) $VERSION
Packit 8dc392
#
Packit 8dc392
# Please DO NOT delete this file!
Packit 8dc392
# It is necessary for linking the library.
Packit 8dc392
Packit 8dc392
# Name of the PIC object.
Packit 8dc392
pic_object=$write_lobj
Packit 8dc392
Packit 8dc392
# Name of the non-PIC object
Packit 8dc392
non_pic_object=$write_oldobj
Packit 8dc392
Packit 8dc392
EOF
Packit 8dc392
      $MV "${write_libobj}T" "${write_libobj}"
Packit 8dc392
    }
Packit 8dc392
}
Packit 8dc392
Packit 8dc392
# func_mode_compile arg...
Packit 8dc392
func_mode_compile ()
Packit 8dc392
{
Packit 8dc392
    $opt_debug
Packit 8dc392
    # Get the compilation command and the source file.
Packit 8dc392
    base_compile=
Packit 8dc392
    srcfile="$nonopt"  #  always keep a non-empty value in "srcfile"
Packit 8dc392
    suppress_opt=yes
Packit 8dc392
    suppress_output=
Packit 8dc392
    arg_mode=normal
Packit 8dc392
    libobj=
Packit 8dc392
    later=
Packit 8dc392
    pie_flag=
Packit 8dc392
Packit 8dc392
    for arg
Packit 8dc392
    do
Packit 8dc392
      case $arg_mode in
Packit 8dc392
      arg  )
Packit 8dc392
	# do not "continue".  Instead, add this to base_compile
Packit 8dc392
	lastarg="$arg"
Packit 8dc392
	arg_mode=normal
Packit 8dc392
	;;
Packit 8dc392
Packit 8dc392
      target )
Packit 8dc392
	libobj="$arg"
Packit 8dc392
	arg_mode=normal
Packit 8dc392
	continue
Packit 8dc392
	;;
Packit 8dc392
Packit 8dc392
      normal )
Packit 8dc392
	# Accept any command-line options.
Packit 8dc392
	case $arg in
Packit 8dc392
	-o)
Packit 8dc392
	  test -n "$libobj" && \
Packit 8dc392
	    func_fatal_error "you cannot specify \`-o' more than once"
Packit 8dc392
	  arg_mode=target
Packit 8dc392
	  continue
Packit 8dc392
	  ;;
Packit 8dc392
Packit 8dc392
	-pie | -fpie | -fPIE)
Packit 8dc392
          pie_flag="$pie_flag $arg"
Packit 8dc392
	  continue
Packit 8dc392
	  ;;
Packit 8dc392
Packit 8dc392
	-shared | -static | -prefer-pic | -prefer-non-pic)
Packit 8dc392
	  later="$later $arg"
Packit 8dc392
	  continue
Packit 8dc392
	  ;;
Packit 8dc392
Packit 8dc392
	-no-suppress)
Packit 8dc392
	  suppress_opt=no
Packit 8dc392
	  continue
Packit 8dc392
	  ;;
Packit 8dc392
Packit 8dc392
	-Xcompiler)
Packit 8dc392
	  arg_mode=arg  #  the next one goes into the "base_compile" arg list
Packit 8dc392
	  continue      #  The current "srcfile" will either be retained or
Packit 8dc392
	  ;;            #  replaced later.  I would guess that would be a bug.
Packit 8dc392
Packit 8dc392
	-Wc,*)
Packit 8dc392
	  func_stripname '-Wc,' '' "$arg"
Packit 8dc392
	  args=$func_stripname_result
Packit 8dc392
	  lastarg=
Packit 8dc392
	  save_ifs="$IFS"; IFS=','
Packit 8dc392
	  for arg in $args; do
Packit 8dc392
	    IFS="$save_ifs"
Packit 8dc392
	    func_quote_for_eval "$arg"
Packit 8dc392
	    lastarg="$lastarg $func_quote_for_eval_result"
Packit 8dc392
	  done
Packit 8dc392
	  IFS="$save_ifs"
Packit 8dc392
	  func_stripname ' ' '' "$lastarg"
Packit 8dc392
	  lastarg=$func_stripname_result
Packit 8dc392
Packit 8dc392
	  # Add the arguments to base_compile.
Packit 8dc392
	  base_compile="$base_compile $lastarg"
Packit 8dc392
	  continue
Packit 8dc392
	  ;;
Packit 8dc392
Packit 8dc392
	*)
Packit 8dc392
	  # Accept the current argument as the source file.
Packit 8dc392
	  # The previous "srcfile" becomes the current argument.
Packit 8dc392
	  #
Packit 8dc392
	  lastarg="$srcfile"
Packit 8dc392
	  srcfile="$arg"
Packit 8dc392
	  ;;
Packit 8dc392
	esac  #  case $arg
Packit 8dc392
	;;
Packit 8dc392
      esac    #  case $arg_mode
Packit 8dc392
Packit 8dc392
      # Aesthetically quote the previous argument.
Packit 8dc392
      func_quote_for_eval "$lastarg"
Packit 8dc392
      base_compile="$base_compile $func_quote_for_eval_result"
Packit 8dc392
    done # for arg
Packit 8dc392
Packit 8dc392
    case $arg_mode in
Packit 8dc392
    arg)
Packit 8dc392
      func_fatal_error "you must specify an argument for -Xcompile"
Packit 8dc392
      ;;
Packit 8dc392
    target)
Packit 8dc392
      func_fatal_error "you must specify a target with \`-o'"
Packit 8dc392
      ;;
Packit 8dc392
    *)
Packit 8dc392
      # Get the name of the library object.
Packit 8dc392
      test -z "$libobj" && {
Packit 8dc392
	func_basename "$srcfile"
Packit 8dc392
	libobj="$func_basename_result"
Packit 8dc392
      }
Packit 8dc392
      ;;
Packit 8dc392
    esac
Packit 8dc392
Packit 8dc392
    # Recognize several different file suffixes.
Packit 8dc392
    # If the user specifies -o file.o, it is replaced with file.lo
Packit 8dc392
    case $libobj in
Packit 8dc392
    *.[cCFSifmso] | \
Packit 8dc392
    *.ada | *.adb | *.ads | *.asm | \
Packit 8dc392
    *.c++ | *.cc | *.ii | *.class | *.cpp | *.cxx | \
Packit 8dc392
    *.[fF][09]? | *.for | *.java | *.obj | *.sx)
Packit 8dc392
      func_xform "$libobj"
Packit 8dc392
      libobj=$func_xform_result
Packit 8dc392
      ;;
Packit 8dc392
    esac
Packit 8dc392
Packit 8dc392
    case $libobj in
Packit 8dc392
    *.lo) func_lo2o "$libobj"; obj=$func_lo2o_result ;;
Packit 8dc392
    *)
Packit 8dc392
      func_fatal_error "cannot determine name of library object from \`$libobj'"
Packit 8dc392
      ;;
Packit 8dc392
    esac
Packit 8dc392
Packit 8dc392
    func_infer_tag $base_compile
Packit 8dc392
Packit 8dc392
    for arg in $later; do
Packit 8dc392
      case $arg in
Packit 8dc392
      -shared)
Packit 8dc392
	test "$build_libtool_libs" != yes && \
Packit 8dc392
	  func_fatal_configuration "can not build a shared library"
Packit 8dc392
	build_old_libs=no
Packit 8dc392
	continue
Packit 8dc392
	;;
Packit 8dc392
Packit 8dc392
      -static)
Packit 8dc392
	build_libtool_libs=no
Packit 8dc392
	build_old_libs=yes
Packit 8dc392
	continue
Packit 8dc392
	;;
Packit 8dc392
Packit 8dc392
      -prefer-pic)
Packit 8dc392
	pic_mode=yes
Packit 8dc392
	continue
Packit 8dc392
	;;
Packit 8dc392
Packit 8dc392
      -prefer-non-pic)
Packit 8dc392
	pic_mode=no
Packit 8dc392
	continue
Packit 8dc392
	;;
Packit 8dc392
      esac
Packit 8dc392
    done
Packit 8dc392
Packit 8dc392
    func_quote_for_eval "$libobj"
Packit 8dc392
    test "X$libobj" != "X$func_quote_for_eval_result" \
Packit 8dc392
      && $ECHO "X$libobj" | $GREP '[]~#^*{};<>?"'"'"'	 &()|`$[]' \
Packit 8dc392
      && func_warning "libobj name \`$libobj' may not contain shell special characters."
Packit 8dc392
    func_dirname_and_basename "$obj" "/" ""
Packit 8dc392
    objname="$func_basename_result"
Packit 8dc392
    xdir="$func_dirname_result"
Packit 8dc392
    lobj=${xdir}$objdir/$objname
Packit 8dc392
Packit 8dc392
    test -z "$base_compile" && \
Packit 8dc392
      func_fatal_help "you must specify a compilation command"
Packit 8dc392
Packit 8dc392
    # Delete any leftover library objects.
Packit 8dc392
    if test "$build_old_libs" = yes; then
Packit 8dc392
      removelist="$obj $lobj $libobj ${libobj}T"
Packit 8dc392
    else
Packit 8dc392
      removelist="$lobj $libobj ${libobj}T"
Packit 8dc392
    fi
Packit 8dc392
Packit 8dc392
    # On Cygwin there's no "real" PIC flag so we must build both object types
Packit 8dc392
    case $host_os in
Packit 8dc392
    cygwin* | mingw* | pw32* | os2* | cegcc*)
Packit 8dc392
      pic_mode=default
Packit 8dc392
      ;;
Packit 8dc392
    esac
Packit 8dc392
    if test "$pic_mode" = no && test "$deplibs_check_method" != pass_all; then
Packit 8dc392
      # non-PIC code in shared libraries is not supported
Packit 8dc392
      pic_mode=default
Packit 8dc392
    fi
Packit 8dc392
Packit 8dc392
    # Calculate the filename of the output object if compiler does
Packit 8dc392
    # not support -o with -c
Packit 8dc392
    if test "$compiler_c_o" = no; then
Packit 8dc392
      output_obj=`$ECHO "X$srcfile" | $Xsed -e 's%^.*/%%' -e 's%\.[^.]*$%%'`.${objext}
Packit 8dc392
      lockfile="$output_obj.lock"
Packit 8dc392
    else
Packit 8dc392
      output_obj=
Packit 8dc392
      need_locks=no
Packit 8dc392
      lockfile=
Packit 8dc392
    fi
Packit 8dc392
Packit 8dc392
    # Lock this critical section if it is needed
Packit 8dc392
    # We use this script file to make the link, it avoids creating a new file
Packit 8dc392
    if test "$need_locks" = yes; then
Packit 8dc392
      until $opt_dry_run || ln "$progpath" "$lockfile" 2>/dev/null; do
Packit 8dc392
	func_echo "Waiting for $lockfile to be removed"
Packit 8dc392
	sleep 2
Packit 8dc392
      done
Packit 8dc392
    elif test "$need_locks" = warn; then
Packit 8dc392
      if test -f "$lockfile"; then
Packit 8dc392
	$ECHO "\
Packit 8dc392
*** ERROR, $lockfile exists and contains:
Packit 8dc392
`cat $lockfile 2>/dev/null`
Packit 8dc392
Packit 8dc392
This indicates that another process is trying to use the same
Packit 8dc392
temporary object file, and libtool could not work around it because
Packit 8dc392
your compiler does not support \`-c' and \`-o' together.  If you
Packit 8dc392
repeat this compilation, it may succeed, by chance, but you had better
Packit 8dc392
avoid parallel builds (make -j) in this platform, or get a better
Packit 8dc392
compiler."
Packit 8dc392
Packit 8dc392
	$opt_dry_run || $RM $removelist
Packit 8dc392
	exit $EXIT_FAILURE
Packit 8dc392
      fi
Packit 8dc392
      removelist="$removelist $output_obj"
Packit 8dc392
      $ECHO "$srcfile" > "$lockfile"
Packit 8dc392
    fi
Packit 8dc392
Packit 8dc392
    $opt_dry_run || $RM $removelist
Packit 8dc392
    removelist="$removelist $lockfile"
Packit 8dc392
    trap '$opt_dry_run || $RM $removelist; exit $EXIT_FAILURE' 1 2 15
Packit 8dc392
Packit 8dc392
    if test -n "$fix_srcfile_path"; then
Packit 8dc392
      eval srcfile=\"$fix_srcfile_path\"
Packit 8dc392
    fi
Packit 8dc392
    func_quote_for_eval "$srcfile"
Packit 8dc392
    qsrcfile=$func_quote_for_eval_result
Packit 8dc392
Packit 8dc392
    # Only build a PIC object if we are building libtool libraries.
Packit 8dc392
    if test "$build_libtool_libs" = yes; then
Packit 8dc392
      # Without this assignment, base_compile gets emptied.
Packit 8dc392
      fbsd_hideous_sh_bug=$base_compile
Packit 8dc392
Packit 8dc392
      if test "$pic_mode" != no; then
Packit 8dc392
	command="$base_compile $qsrcfile $pic_flag"
Packit 8dc392
      else
Packit 8dc392
	# Don't build PIC code
Packit 8dc392
	command="$base_compile $qsrcfile"
Packit 8dc392
      fi
Packit 8dc392
Packit 8dc392
      func_mkdir_p "$xdir$objdir"
Packit 8dc392
Packit 8dc392
      if test -z "$output_obj"; then
Packit 8dc392
	# Place PIC objects in $objdir
Packit 8dc392
	command="$command -o $lobj"
Packit 8dc392
      fi
Packit 8dc392
Packit 8dc392
      func_show_eval_locale "$command"	\
Packit 8dc392
          'test -n "$output_obj" && $RM $removelist; exit $EXIT_FAILURE'
Packit 8dc392
Packit 8dc392
      if test "$need_locks" = warn &&
Packit 8dc392
	 test "X`cat $lockfile 2>/dev/null`" != "X$srcfile"; then
Packit 8dc392
	$ECHO "\
Packit 8dc392
*** ERROR, $lockfile contains:
Packit 8dc392
`cat $lockfile 2>/dev/null`
Packit 8dc392
Packit 8dc392
but it should contain:
Packit 8dc392
$srcfile
Packit 8dc392
Packit 8dc392
This indicates that another process is trying to use the same
Packit 8dc392
temporary object file, and libtool could not work around it because
Packit 8dc392
your compiler does not support \`-c' and \`-o' together.  If you
Packit 8dc392
repeat this compilation, it may succeed, by chance, but you had better
Packit 8dc392
avoid parallel builds (make -j) in this platform, or get a better
Packit 8dc392
compiler."
Packit 8dc392
Packit 8dc392
	$opt_dry_run || $RM $removelist
Packit 8dc392
	exit $EXIT_FAILURE
Packit 8dc392
      fi
Packit 8dc392
Packit 8dc392
      # Just move the object if needed, then go on to compile the next one
Packit 8dc392
      if test -n "$output_obj" && test "X$output_obj" != "X$lobj"; then
Packit 8dc392
	func_show_eval '$MV "$output_obj" "$lobj"' \
Packit 8dc392
	  'error=$?; $opt_dry_run || $RM $removelist; exit $error'
Packit 8dc392
      fi
Packit 8dc392
Packit 8dc392
      # Allow error messages only from the first compilation.
Packit 8dc392
      if test "$suppress_opt" = yes; then
Packit 8dc392
	suppress_output=' >/dev/null 2>&1'
Packit 8dc392
      fi
Packit 8dc392
    fi
Packit 8dc392
Packit 8dc392
    # Only build a position-dependent object if we build old libraries.
Packit 8dc392
    if test "$build_old_libs" = yes; then
Packit 8dc392
      if test "$pic_mode" != yes; then
Packit 8dc392
	# Don't build PIC code
Packit 8dc392
	command="$base_compile $qsrcfile$pie_flag"
Packit 8dc392
      else
Packit 8dc392
	command="$base_compile $qsrcfile $pic_flag"
Packit 8dc392
      fi
Packit 8dc392
      if test "$compiler_c_o" = yes; then
Packit 8dc392
	command="$command -o $obj"
Packit 8dc392
      fi
Packit 8dc392
Packit 8dc392
      # Suppress compiler output if we already did a PIC compilation.
Packit 8dc392
      command="$command$suppress_output"
Packit 8dc392
      func_show_eval_locale "$command" \
Packit 8dc392
        '$opt_dry_run || $RM $removelist; exit $EXIT_FAILURE'
Packit 8dc392
Packit 8dc392
      if test "$need_locks" = warn &&
Packit 8dc392
	 test "X`cat $lockfile 2>/dev/null`" != "X$srcfile"; then
Packit 8dc392
	$ECHO "\
Packit 8dc392
*** ERROR, $lockfile contains:
Packit 8dc392
`cat $lockfile 2>/dev/null`
Packit 8dc392
Packit 8dc392
but it should contain:
Packit 8dc392
$srcfile
Packit 8dc392
Packit 8dc392
This indicates that another process is trying to use the same
Packit 8dc392
temporary object file, and libtool could not work around it because
Packit 8dc392
your compiler does not support \`-c' and \`-o' together.  If you
Packit 8dc392
repeat this compilation, it may succeed, by chance, but you had better
Packit 8dc392
avoid parallel builds (make -j) in this platform, or get a better
Packit 8dc392
compiler."
Packit 8dc392
Packit 8dc392
	$opt_dry_run || $RM $removelist
Packit 8dc392
	exit $EXIT_FAILURE
Packit 8dc392
      fi
Packit 8dc392
Packit 8dc392
      # Just move the object if needed
Packit 8dc392
      if test -n "$output_obj" && test "X$output_obj" != "X$obj"; then
Packit 8dc392
	func_show_eval '$MV "$output_obj" "$obj"' \
Packit 8dc392
	  'error=$?; $opt_dry_run || $RM $removelist; exit $error'
Packit 8dc392
      fi
Packit 8dc392
    fi
Packit 8dc392
Packit 8dc392
    $opt_dry_run || {
Packit 8dc392
      func_write_libtool_object "$libobj" "$objdir/$objname" "$objname"
Packit 8dc392
Packit 8dc392
      # Unlock the critical section if it was locked
Packit 8dc392
      if test "$need_locks" != no; then
Packit 8dc392
	removelist=$lockfile
Packit 8dc392
        $RM "$lockfile"
Packit 8dc392
      fi
Packit 8dc392
    }
Packit 8dc392
Packit 8dc392
    exit $EXIT_SUCCESS
Packit 8dc392
}
Packit 8dc392
Packit 8dc392
$opt_help || {
Packit 8dc392
test "$mode" = compile && func_mode_compile ${1+"$@"}
Packit 8dc392
}
Packit 8dc392
Packit 8dc392
func_mode_help ()
Packit 8dc392
{
Packit 8dc392
    # We need to display help for each of the modes.
Packit 8dc392
    case $mode in
Packit 8dc392
      "")
Packit 8dc392
        # Generic help is extracted from the usage comments
Packit 8dc392
        # at the start of this file.
Packit 8dc392
        func_help
Packit 8dc392
        ;;
Packit 8dc392
Packit 8dc392
      clean)
Packit 8dc392
        $ECHO \
Packit 8dc392
"Usage: $progname [OPTION]... --mode=clean RM [RM-OPTION]... FILE...
Packit 8dc392
Packit 8dc392
Remove files from the build directory.
Packit 8dc392
Packit 8dc392
RM is the name of the program to use to delete files associated with each FILE
Packit 8dc392
(typically \`/bin/rm').  RM-OPTIONS are options (such as \`-f') to be passed
Packit 8dc392
to RM.
Packit 8dc392
Packit 8dc392
If FILE is a libtool library, object or program, all the files associated
Packit 8dc392
with it are deleted. Otherwise, only FILE itself is deleted using RM."
Packit 8dc392
        ;;
Packit 8dc392
Packit 8dc392
      compile)
Packit 8dc392
      $ECHO \
Packit 8dc392
"Usage: $progname [OPTION]... --mode=compile COMPILE-COMMAND... SOURCEFILE
Packit 8dc392
Packit 8dc392
Compile a source file into a libtool library object.
Packit 8dc392
Packit 8dc392
This mode accepts the following additional options:
Packit 8dc392
Packit 8dc392
  -o OUTPUT-FILE    set the output file name to OUTPUT-FILE
Packit 8dc392
  -no-suppress      do not suppress compiler output for multiple passes
Packit 8dc392
  -prefer-pic       try to building PIC objects only
Packit 8dc392
  -prefer-non-pic   try to building non-PIC objects only
Packit 8dc392
  -shared           do not build a \`.o' file suitable for static linking
Packit 8dc392
  -static           only build a \`.o' file suitable for static linking
Packit 8dc392
Packit 8dc392
COMPILE-COMMAND is a command to be used in creating a \`standard' object file
Packit 8dc392
from the given SOURCEFILE.
Packit 8dc392
Packit 8dc392
The output file name is determined by removing the directory component from
Packit 8dc392
SOURCEFILE, then substituting the C source code suffix \`.c' with the
Packit 8dc392
library object suffix, \`.lo'."
Packit 8dc392
        ;;
Packit 8dc392
Packit 8dc392
      execute)
Packit 8dc392
        $ECHO \
Packit 8dc392
"Usage: $progname [OPTION]... --mode=execute COMMAND [ARGS]...
Packit 8dc392
Packit 8dc392
Automatically set library path, then run a program.
Packit 8dc392
Packit 8dc392
This mode accepts the following additional options:
Packit 8dc392
Packit 8dc392
  -dlopen FILE      add the directory containing FILE to the library path
Packit 8dc392
Packit 8dc392
This mode sets the library path environment variable according to \`-dlopen'
Packit 8dc392
flags.
Packit 8dc392
Packit 8dc392
If any of the ARGS are libtool executable wrappers, then they are translated
Packit 8dc392
into their corresponding uninstalled binary, and any of their required library
Packit 8dc392
directories are added to the library path.
Packit 8dc392
Packit 8dc392
Then, COMMAND is executed, with ARGS as arguments."
Packit 8dc392
        ;;
Packit 8dc392
Packit 8dc392
      finish)
Packit 8dc392
        $ECHO \
Packit 8dc392
"Usage: $progname [OPTION]... --mode=finish [LIBDIR]...
Packit 8dc392
Packit 8dc392
Complete the installation of libtool libraries.
Packit 8dc392
Packit 8dc392
Each LIBDIR is a directory that contains libtool libraries.
Packit 8dc392
Packit 8dc392
The commands that this mode executes may require superuser privileges.  Use
Packit 8dc392
the \`--dry-run' option if you just want to see what would be executed."
Packit 8dc392
        ;;
Packit 8dc392
Packit 8dc392
      install)
Packit 8dc392
        $ECHO \
Packit 8dc392
"Usage: $progname [OPTION]... --mode=install INSTALL-COMMAND...
Packit 8dc392
Packit 8dc392
Install executables or libraries.
Packit 8dc392
Packit 8dc392
INSTALL-COMMAND is the installation command.  The first component should be
Packit 8dc392
either the \`install' or \`cp' program.
Packit 8dc392
Packit 8dc392
The following components of INSTALL-COMMAND are treated specially:
Packit 8dc392
Packit 8dc392
  -inst-prefix PREFIX-DIR  Use PREFIX-DIR as a staging area for installation
Packit 8dc392
Packit 8dc392
The rest of the components are interpreted as arguments to that command (only
Packit 8dc392
BSD-compatible install options are recognized)."
Packit 8dc392
        ;;
Packit 8dc392
Packit 8dc392
      link)
Packit 8dc392
        $ECHO \
Packit 8dc392
"Usage: $progname [OPTION]... --mode=link LINK-COMMAND...
Packit 8dc392
Packit 8dc392
Link object files or libraries together to form another library, or to
Packit 8dc392
create an executable program.
Packit 8dc392
Packit 8dc392
LINK-COMMAND is a command using the C compiler that you would use to create
Packit 8dc392
a program from several object files.
Packit 8dc392
Packit 8dc392
The following components of LINK-COMMAND are treated specially:
Packit 8dc392
Packit 8dc392
  -all-static       do not do any dynamic linking at all
Packit 8dc392
  -avoid-version    do not add a version suffix if possible
Packit 8dc392
  -dlopen FILE      \`-dlpreopen' FILE if it cannot be dlopened at runtime
Packit 8dc392
  -dlpreopen FILE   link in FILE and add its symbols to lt_preloaded_symbols
Packit 8dc392
  -export-dynamic   allow symbols from OUTPUT-FILE to be resolved with dlsym(3)
Packit 8dc392
  -export-symbols SYMFILE
Packit 8dc392
                    try to export only the symbols listed in SYMFILE
Packit 8dc392
  -export-symbols-regex REGEX
Packit 8dc392
                    try to export only the symbols matching REGEX
Packit 8dc392
  -LLIBDIR          search LIBDIR for required installed libraries
Packit 8dc392
  -lNAME            OUTPUT-FILE requires the installed library libNAME
Packit 8dc392
  -module           build a library that can dlopened
Packit 8dc392
  -no-fast-install  disable the fast-install mode
Packit 8dc392
  -no-install       link a not-installable executable
Packit 8dc392
  -no-undefined     declare that a library does not refer to external symbols
Packit 8dc392
  -o OUTPUT-FILE    create OUTPUT-FILE from the specified objects
Packit 8dc392
  -objectlist FILE  Use a list of object files found in FILE to specify objects
Packit 8dc392
  -precious-files-regex REGEX
Packit 8dc392
                    don't remove output files matching REGEX
Packit 8dc392
  -release RELEASE  specify package release information
Packit 8dc392
  -rpath LIBDIR     the created library will eventually be installed in LIBDIR
Packit 8dc392
  -R[ ]LIBDIR       add LIBDIR to the runtime path of programs and libraries
Packit 8dc392
  -shared           only do dynamic linking of libtool libraries
Packit 8dc392
  -shrext SUFFIX    override the standard shared library file extension
Packit 8dc392
  -static           do not do any dynamic linking of uninstalled libtool libraries
Packit 8dc392
  -static-libtool-libs
Packit 8dc392
                    do not do any dynamic linking of libtool libraries
Packit 8dc392
  -version-info CURRENT[:REVISION[:AGE]]
Packit 8dc392
                    specify library version info [each variable defaults to 0]
Packit 8dc392
  -weak LIBNAME     declare that the target provides the LIBNAME interface
Packit 8dc392
Packit 8dc392
All other options (arguments beginning with \`-') are ignored.
Packit 8dc392
Packit 8dc392
Every other argument is treated as a filename.  Files ending in \`.la' are
Packit 8dc392
treated as uninstalled libtool libraries, other files are standard or library
Packit 8dc392
object files.
Packit 8dc392
Packit 8dc392
If the OUTPUT-FILE ends in \`.la', then a libtool library is created,
Packit 8dc392
only library objects (\`.lo' files) may be specified, and \`-rpath' is
Packit 8dc392
required, except when creating a convenience library.
Packit 8dc392
Packit 8dc392
If OUTPUT-FILE ends in \`.a' or \`.lib', then a standard library is created
Packit 8dc392
using \`ar' and \`ranlib', or on Windows using \`lib'.
Packit 8dc392
Packit 8dc392
If OUTPUT-FILE ends in \`.lo' or \`.${objext}', then a reloadable object file
Packit 8dc392
is created, otherwise an executable program is created."
Packit 8dc392
        ;;
Packit 8dc392
Packit 8dc392
      uninstall)
Packit 8dc392
        $ECHO \
Packit 8dc392
"Usage: $progname [OPTION]... --mode=uninstall RM [RM-OPTION]... FILE...
Packit 8dc392
Packit 8dc392
Remove libraries from an installation directory.
Packit 8dc392
Packit 8dc392
RM is the name of the program to use to delete files associated with each FILE
Packit 8dc392
(typically \`/bin/rm').  RM-OPTIONS are options (such as \`-f') to be passed
Packit 8dc392
to RM.
Packit 8dc392
Packit 8dc392
If FILE is a libtool library, all the files associated with it are deleted.
Packit 8dc392
Otherwise, only FILE itself is deleted using RM."
Packit 8dc392
        ;;
Packit 8dc392
Packit 8dc392
      *)
Packit 8dc392
        func_fatal_help "invalid operation mode \`$mode'"
Packit 8dc392
        ;;
Packit 8dc392
    esac
Packit 8dc392
Packit 8dc392
    $ECHO
Packit 8dc392
    $ECHO "Try \`$progname --help' for more information about other modes."
Packit 8dc392
Packit 8dc392
    exit $?
Packit 8dc392
}
Packit 8dc392
Packit 8dc392
  # Now that we've collected a possible --mode arg, show help if necessary
Packit 8dc392
  $opt_help && func_mode_help
Packit 8dc392
Packit 8dc392
Packit 8dc392
# func_mode_execute arg...
Packit 8dc392
func_mode_execute ()
Packit 8dc392
{
Packit 8dc392
    $opt_debug
Packit 8dc392
    # The first argument is the command name.
Packit 8dc392
    cmd="$nonopt"
Packit 8dc392
    test -z "$cmd" && \
Packit 8dc392
      func_fatal_help "you must specify a COMMAND"
Packit 8dc392
Packit 8dc392
    # Handle -dlopen flags immediately.
Packit 8dc392
    for file in $execute_dlfiles; do
Packit 8dc392
      test -f "$file" \
Packit 8dc392
	|| func_fatal_help "\`$file' is not a file"
Packit 8dc392
Packit 8dc392
      dir=
Packit 8dc392
      case $file in
Packit 8dc392
      *.la)
Packit 8dc392
	# Check to see that this really is a libtool archive.
Packit 8dc392
	func_lalib_unsafe_p "$file" \
Packit 8dc392
	  || func_fatal_help "\`$lib' is not a valid libtool archive"
Packit 8dc392
Packit 8dc392
	# Read the libtool library.
Packit 8dc392
	dlname=
Packit 8dc392
	library_names=
Packit 8dc392
	func_source "$file"
Packit 8dc392
Packit 8dc392
	# Skip this library if it cannot be dlopened.
Packit 8dc392
	if test -z "$dlname"; then
Packit 8dc392
	  # Warn if it was a shared library.
Packit 8dc392
	  test -n "$library_names" && \
Packit 8dc392
	    func_warning "\`$file' was not linked with \`-export-dynamic'"
Packit 8dc392
	  continue
Packit 8dc392
	fi
Packit 8dc392
Packit 8dc392
	func_dirname "$file" "" "."
Packit 8dc392
	dir="$func_dirname_result"
Packit 8dc392
Packit 8dc392
	if test -f "$dir/$objdir/$dlname"; then
Packit 8dc392
	  dir="$dir/$objdir"
Packit 8dc392
	else
Packit 8dc392
	  if test ! -f "$dir/$dlname"; then
Packit 8dc392
	    func_fatal_error "cannot find \`$dlname' in \`$dir' or \`$dir/$objdir'"
Packit 8dc392
	  fi
Packit 8dc392
	fi
Packit 8dc392
	;;
Packit 8dc392
Packit 8dc392
      *.lo)
Packit 8dc392
	# Just add the directory containing the .lo file.
Packit 8dc392
	func_dirname "$file" "" "."
Packit 8dc392
	dir="$func_dirname_result"
Packit 8dc392
	;;
Packit 8dc392
Packit 8dc392
      *)
Packit 8dc392
	func_warning "\`-dlopen' is ignored for non-libtool libraries and objects"
Packit 8dc392
	continue
Packit 8dc392
	;;
Packit 8dc392
      esac
Packit 8dc392
Packit 8dc392
      # Get the absolute pathname.
Packit 8dc392
      absdir=`cd "$dir" && pwd`
Packit 8dc392
      test -n "$absdir" && dir="$absdir"
Packit 8dc392
Packit 8dc392
      # Now add the directory to shlibpath_var.
Packit 8dc392
      if eval "test -z \"\$$shlibpath_var\""; then
Packit 8dc392
	eval "$shlibpath_var=\"\$dir\""
Packit 8dc392
      else
Packit 8dc392
	eval "$shlibpath_var=\"\$dir:\$$shlibpath_var\""
Packit 8dc392
      fi
Packit 8dc392
    done
Packit 8dc392
Packit 8dc392
    # This variable tells wrapper scripts just to set shlibpath_var
Packit 8dc392
    # rather than running their programs.
Packit 8dc392
    libtool_execute_magic="$magic"
Packit 8dc392
Packit 8dc392
    # Check if any of the arguments is a wrapper script.
Packit 8dc392
    args=
Packit 8dc392
    for file
Packit 8dc392
    do
Packit 8dc392
      case $file in
Packit 8dc392
      -*) ;;
Packit 8dc392
      *)
Packit 8dc392
	# Do a test to see if this is really a libtool program.
Packit 8dc392
	if func_ltwrapper_script_p "$file"; then
Packit 8dc392
	  func_source "$file"
Packit 8dc392
	  # Transform arg to wrapped name.
Packit 8dc392
	  file="$progdir/$program"
Packit 8dc392
	elif func_ltwrapper_executable_p "$file"; then
Packit 8dc392
	  func_ltwrapper_scriptname "$file"
Packit 8dc392
	  func_source "$func_ltwrapper_scriptname_result"
Packit 8dc392
	  # Transform arg to wrapped name.
Packit 8dc392
	  file="$progdir/$program"
Packit 8dc392
	fi
Packit 8dc392
	;;
Packit 8dc392
      esac
Packit 8dc392
      # Quote arguments (to preserve shell metacharacters).
Packit 8dc392
      func_quote_for_eval "$file"
Packit 8dc392
      args="$args $func_quote_for_eval_result"
Packit 8dc392
    done
Packit 8dc392
Packit 8dc392
    if test "X$opt_dry_run" = Xfalse; then
Packit 8dc392
      if test -n "$shlibpath_var"; then
Packit 8dc392
	# Export the shlibpath_var.
Packit 8dc392
	eval "export $shlibpath_var"
Packit 8dc392
      fi
Packit 8dc392
Packit 8dc392
      # Restore saved environment variables
Packit 8dc392
      for lt_var in LANG LANGUAGE LC_ALL LC_CTYPE LC_COLLATE LC_MESSAGES
Packit 8dc392
      do
Packit 8dc392
	eval "if test \"\${save_$lt_var+set}\" = set; then
Packit 8dc392
                $lt_var=\$save_$lt_var; export $lt_var
Packit 8dc392
	      else
Packit 8dc392
		$lt_unset $lt_var
Packit 8dc392
	      fi"
Packit 8dc392
      done
Packit 8dc392
Packit 8dc392
      # Now prepare to actually exec the command.
Packit 8dc392
      exec_cmd="\$cmd$args"
Packit 8dc392
    else
Packit 8dc392
      # Display what would be done.
Packit 8dc392
      if test -n "$shlibpath_var"; then
Packit 8dc392
	eval "\$ECHO \"\$shlibpath_var=\$$shlibpath_var\""
Packit 8dc392
	$ECHO "export $shlibpath_var"
Packit 8dc392
      fi
Packit 8dc392
      $ECHO "$cmd$args"
Packit 8dc392
      exit $EXIT_SUCCESS
Packit 8dc392
    fi
Packit 8dc392
}
Packit 8dc392
Packit 8dc392
test "$mode" = execute && func_mode_execute ${1+"$@"}
Packit 8dc392
Packit 8dc392
Packit 8dc392
# func_mode_finish arg...
Packit 8dc392
func_mode_finish ()
Packit 8dc392
{
Packit 8dc392
    $opt_debug
Packit 8dc392
    libdirs="$nonopt"
Packit 8dc392
    admincmds=
Packit 8dc392
Packit 8dc392
    if test -n "$finish_cmds$finish_eval" && test -n "$libdirs"; then
Packit 8dc392
      for dir
Packit 8dc392
      do
Packit 8dc392
	libdirs="$libdirs $dir"
Packit 8dc392
      done
Packit 8dc392
Packit 8dc392
      for libdir in $libdirs; do
Packit 8dc392
	if test -n "$finish_cmds"; then
Packit 8dc392
	  # Do each command in the finish commands.
Packit 8dc392
	  func_execute_cmds "$finish_cmds" 'admincmds="$admincmds
Packit 8dc392
'"$cmd"'"'
Packit 8dc392
	fi
Packit 8dc392
	if test -n "$finish_eval"; then
Packit 8dc392
	  # Do the single finish_eval.
Packit 8dc392
	  eval cmds=\"$finish_eval\"
Packit 8dc392
	  $opt_dry_run || eval "$cmds" || admincmds="$admincmds
Packit 8dc392
       $cmds"
Packit 8dc392
	fi
Packit 8dc392
      done
Packit 8dc392
    fi
Packit 8dc392
Packit 8dc392
    # Exit here if they wanted silent mode.
Packit 8dc392
    $opt_silent && exit $EXIT_SUCCESS
Packit 8dc392
Packit 8dc392
    $ECHO "X----------------------------------------------------------------------" | $Xsed
Packit 8dc392
    $ECHO "Libraries have been installed in:"
Packit 8dc392
    for libdir in $libdirs; do
Packit 8dc392
      $ECHO "   $libdir"
Packit 8dc392
    done
Packit 8dc392
    $ECHO
Packit 8dc392
    $ECHO "If you ever happen to want to link against installed libraries"
Packit 8dc392
    $ECHO "in a given directory, LIBDIR, you must either use libtool, and"
Packit 8dc392
    $ECHO "specify the full pathname of the library, or use the \`-LLIBDIR'"
Packit 8dc392
    $ECHO "flag during linking and do at least one of the following:"
Packit 8dc392
    if test -n "$shlibpath_var"; then
Packit 8dc392
      $ECHO "   - add LIBDIR to the \`$shlibpath_var' environment variable"
Packit 8dc392
      $ECHO "     during execution"
Packit 8dc392
    fi
Packit 8dc392
    if test -n "$runpath_var"; then
Packit 8dc392
      $ECHO "   - add LIBDIR to the \`$runpath_var' environment variable"
Packit 8dc392
      $ECHO "     during linking"
Packit 8dc392
    fi
Packit 8dc392
    if test -n "$hardcode_libdir_flag_spec"; then
Packit 8dc392
      libdir=LIBDIR
Packit 8dc392
      eval flag=\"$hardcode_libdir_flag_spec\"
Packit 8dc392
Packit 8dc392
      $ECHO "   - use the \`$flag' linker flag"
Packit 8dc392
    fi
Packit 8dc392
    if test -n "$admincmds"; then
Packit 8dc392
      $ECHO "   - have your system administrator run these commands:$admincmds"
Packit 8dc392
    fi
Packit 8dc392
    if test -f /etc/ld.so.conf; then
Packit 8dc392
      $ECHO "   - have your system administrator add LIBDIR to \`/etc/ld.so.conf'"
Packit 8dc392
    fi
Packit 8dc392
    $ECHO
Packit 8dc392
Packit 8dc392
    $ECHO "See any operating system documentation about shared libraries for"
Packit 8dc392
    case $host in
Packit 8dc392
      solaris2.[6789]|solaris2.1[0-9])
Packit 8dc392
        $ECHO "more information, such as the ld(1), crle(1) and ld.so(8) manual"
Packit 8dc392
	$ECHO "pages."
Packit 8dc392
	;;
Packit 8dc392
      *)
Packit 8dc392
        $ECHO "more information, such as the ld(1) and ld.so(8) manual pages."
Packit 8dc392
        ;;
Packit 8dc392
    esac
Packit 8dc392
    $ECHO "X----------------------------------------------------------------------" | $Xsed
Packit 8dc392
    exit $EXIT_SUCCESS
Packit 8dc392
}
Packit 8dc392
Packit 8dc392
test "$mode" = finish && func_mode_finish ${1+"$@"}
Packit 8dc392
Packit 8dc392
Packit 8dc392
# func_mode_install arg...
Packit 8dc392
func_mode_install ()
Packit 8dc392
{
Packit 8dc392
    $opt_debug
Packit 8dc392
    # There may be an optional sh(1) argument at the beginning of
Packit 8dc392
    # install_prog (especially on Windows NT).
Packit 8dc392
    if test "$nonopt" = "$SHELL" || test "$nonopt" = /bin/sh ||
Packit 8dc392
       # Allow the use of GNU shtool's install command.
Packit 8dc392
       $ECHO "X$nonopt" | $GREP shtool >/dev/null; then
Packit 8dc392
      # Aesthetically quote it.
Packit 8dc392
      func_quote_for_eval "$nonopt"
Packit 8dc392
      install_prog="$func_quote_for_eval_result "
Packit 8dc392
      arg=$1
Packit 8dc392
      shift
Packit 8dc392
    else
Packit 8dc392
      install_prog=
Packit 8dc392
      arg=$nonopt
Packit 8dc392
    fi
Packit 8dc392
Packit 8dc392
    # The real first argument should be the name of the installation program.
Packit 8dc392
    # Aesthetically quote it.
Packit 8dc392
    func_quote_for_eval "$arg"
Packit 8dc392
    install_prog="$install_prog$func_quote_for_eval_result"
Packit 8dc392
Packit 8dc392
    # We need to accept at least all the BSD install flags.
Packit 8dc392
    dest=
Packit 8dc392
    files=
Packit 8dc392
    opts=
Packit 8dc392
    prev=
Packit 8dc392
    install_type=
Packit 8dc392
    isdir=no
Packit 8dc392
    stripme=
Packit 8dc392
    for arg
Packit 8dc392
    do
Packit 8dc392
      if test -n "$dest"; then
Packit 8dc392
	files="$files $dest"
Packit 8dc392
	dest=$arg
Packit 8dc392
	continue
Packit 8dc392
      fi
Packit 8dc392
Packit 8dc392
      case $arg in
Packit 8dc392
      -d) isdir=yes ;;
Packit 8dc392
      -f)
Packit 8dc392
	case " $install_prog " in
Packit 8dc392
	*[\\\ /]cp\ *) ;;
Packit 8dc392
	*) prev=$arg ;;
Packit 8dc392
	esac
Packit 8dc392
	;;
Packit 8dc392
      -g | -m | -o)
Packit 8dc392
	prev=$arg
Packit 8dc392
	;;
Packit 8dc392
      -s)
Packit 8dc392
	stripme=" -s"
Packit 8dc392
	continue
Packit 8dc392
	;;
Packit 8dc392
      -*)
Packit 8dc392
	;;
Packit 8dc392
      *)
Packit 8dc392
	# If the previous option needed an argument, then skip it.
Packit 8dc392
	if test -n "$prev"; then
Packit 8dc392
	  prev=
Packit 8dc392
	else
Packit 8dc392
	  dest=$arg
Packit 8dc392
	  continue
Packit 8dc392
	fi
Packit 8dc392
	;;
Packit 8dc392
      esac
Packit 8dc392
Packit 8dc392
      # Aesthetically quote the argument.
Packit 8dc392
      func_quote_for_eval "$arg"
Packit 8dc392
      install_prog="$install_prog $func_quote_for_eval_result"
Packit 8dc392
    done
Packit 8dc392
Packit 8dc392
    test -z "$install_prog" && \
Packit 8dc392
      func_fatal_help "you must specify an install program"
Packit 8dc392
Packit 8dc392
    test -n "$prev" && \
Packit 8dc392
      func_fatal_help "the \`$prev' option requires an argument"
Packit 8dc392
Packit 8dc392
    if test -z "$files"; then
Packit 8dc392
      if test -z "$dest"; then
Packit 8dc392
	func_fatal_help "no file or destination specified"
Packit 8dc392
      else
Packit 8dc392
	func_fatal_help "you must specify a destination"
Packit 8dc392
      fi
Packit 8dc392
    fi
Packit 8dc392
Packit 8dc392
    # Strip any trailing slash from the destination.
Packit 8dc392
    func_stripname '' '/' "$dest"
Packit 8dc392
    dest=$func_stripname_result
Packit 8dc392
Packit 8dc392
    # Check to see that the destination is a directory.
Packit 8dc392
    test -d "$dest" && isdir=yes
Packit 8dc392
    if test "$isdir" = yes; then
Packit 8dc392
      destdir="$dest"
Packit 8dc392
      destname=
Packit 8dc392
    else
Packit 8dc392
      func_dirname_and_basename "$dest" "" "."
Packit 8dc392
      destdir="$func_dirname_result"
Packit 8dc392
      destname="$func_basename_result"
Packit 8dc392
Packit 8dc392
      # Not a directory, so check to see that there is only one file specified.
Packit 8dc392
      set dummy $files; shift
Packit 8dc392
      test "$#" -gt 1 && \
Packit 8dc392
	func_fatal_help "\`$dest' is not a directory"
Packit 8dc392
    fi
Packit 8dc392
    case $destdir in
Packit 8dc392
    [\\/]* | [A-Za-z]:[\\/]*) ;;
Packit 8dc392
    *)
Packit 8dc392
      for file in $files; do
Packit 8dc392
	case $file in
Packit 8dc392
	*.lo) ;;
Packit 8dc392
	*)
Packit 8dc392
	  func_fatal_help "\`$destdir' must be an absolute directory name"
Packit 8dc392
	  ;;
Packit 8dc392
	esac
Packit 8dc392
      done
Packit 8dc392
      ;;
Packit 8dc392
    esac
Packit 8dc392
Packit 8dc392
    # This variable tells wrapper scripts just to set variables rather
Packit 8dc392
    # than running their programs.
Packit 8dc392
    libtool_install_magic="$magic"
Packit 8dc392
Packit 8dc392
    staticlibs=
Packit 8dc392
    future_libdirs=
Packit 8dc392
    current_libdirs=
Packit 8dc392
    for file in $files; do
Packit 8dc392
Packit 8dc392
      # Do each installation.
Packit 8dc392
      case $file in
Packit 8dc392
      *.$libext)
Packit 8dc392
	# Do the static libraries later.
Packit 8dc392
	staticlibs="$staticlibs $file"
Packit 8dc392
	;;
Packit 8dc392
Packit 8dc392
      *.la)
Packit 8dc392
	# Check to see that this really is a libtool archive.
Packit 8dc392
	func_lalib_unsafe_p "$file" \
Packit 8dc392
	  || func_fatal_help "\`$file' is not a valid libtool archive"
Packit 8dc392
Packit 8dc392
	library_names=
Packit 8dc392
	old_library=
Packit 8dc392
	relink_command=
Packit 8dc392
	func_source "$file"
Packit 8dc392
Packit 8dc392
	# Add the libdir to current_libdirs if it is the destination.
Packit 8dc392
	if test "X$destdir" = "X$libdir"; then
Packit 8dc392
	  case "$current_libdirs " in
Packit 8dc392
	  *" $libdir "*) ;;
Packit 8dc392
	  *) current_libdirs="$current_libdirs $libdir" ;;
Packit 8dc392
	  esac
Packit 8dc392
	else
Packit 8dc392
	  # Note the libdir as a future libdir.
Packit 8dc392
	  case "$future_libdirs " in
Packit 8dc392
	  *" $libdir "*) ;;
Packit 8dc392
	  *) future_libdirs="$future_libdirs $libdir" ;;
Packit 8dc392
	  esac
Packit 8dc392
	fi
Packit 8dc392
Packit 8dc392
	func_dirname "$file" "/" ""
Packit 8dc392
	dir="$func_dirname_result"
Packit 8dc392
	dir="$dir$objdir"
Packit 8dc392
Packit 8dc392
	if test -n "$relink_command"; then
Packit 8dc392
	  # Determine the prefix the user has applied to our future dir.
Packit 8dc392
	  inst_prefix_dir=`$ECHO "X$destdir" | $Xsed -e "s%$libdir\$%%"`
Packit 8dc392
Packit 8dc392
	  # Don't allow the user to place us outside of our expected
Packit 8dc392
	  # location b/c this prevents finding dependent libraries that
Packit 8dc392
	  # are installed to the same prefix.
Packit 8dc392
	  # At present, this check doesn't affect windows .dll's that
Packit 8dc392
	  # are installed into $libdir/../bin (currently, that works fine)
Packit 8dc392
	  # but it's something to keep an eye on.
Packit 8dc392
	  test "$inst_prefix_dir" = "$destdir" && \
Packit 8dc392
	    func_fatal_error "error: cannot install \`$file' to a directory not ending in $libdir"
Packit 8dc392
Packit 8dc392
	  if test -n "$inst_prefix_dir"; then
Packit 8dc392
	    # Stick the inst_prefix_dir data into the link command.
Packit 8dc392
	    relink_command=`$ECHO "X$relink_command" | $Xsed -e "s%@inst_prefix_dir@%-inst-prefix-dir $inst_prefix_dir%"`
Packit 8dc392
	  else
Packit 8dc392
	    relink_command=`$ECHO "X$relink_command" | $Xsed -e "s%@inst_prefix_dir@%%"`
Packit 8dc392
	  fi
Packit 8dc392
Packit 8dc392
	  func_warning "relinking \`$file'"
Packit 8dc392
	  func_show_eval "$relink_command" \
Packit 8dc392
	    'func_fatal_error "error: relink \`$file'\'' with the above command before installing it"'
Packit 8dc392
	fi
Packit 8dc392
Packit 8dc392
	# See the names of the shared library.
Packit 8dc392
	set dummy $library_names; shift
Packit 8dc392
	if test -n "$1"; then
Packit 8dc392
	  realname="$1"
Packit 8dc392
	  shift
Packit 8dc392
Packit 8dc392
	  srcname="$realname"
Packit 8dc392
	  test -n "$relink_command" && srcname="$realname"T
Packit 8dc392
Packit 8dc392
	  # Install the shared library and build the symlinks.
Packit 8dc392
	  func_show_eval "$install_prog $dir/$srcname $destdir/$realname" \
Packit 8dc392
	      'exit $?'
Packit 8dc392
	  tstripme="$stripme"
Packit 8dc392
	  case $host_os in
Packit 8dc392
	  cygwin* | mingw* | pw32* | cegcc*)
Packit 8dc392
	    case $realname in
Packit 8dc392
	    *.dll.a)
Packit 8dc392
	      tstripme=""
Packit 8dc392
	      ;;
Packit 8dc392
	    esac
Packit 8dc392
	    ;;
Packit 8dc392
	  esac
Packit 8dc392
	  if test -n "$tstripme" && test -n "$striplib"; then
Packit 8dc392
	    func_show_eval "$striplib $destdir/$realname" 'exit $?'
Packit 8dc392
	  fi
Packit 8dc392
Packit 8dc392
	  if test "$#" -gt 0; then
Packit 8dc392
	    # Delete the old symlinks, and create new ones.
Packit 8dc392
	    # Try `ln -sf' first, because the `ln' binary might depend on
Packit 8dc392
	    # the symlink we replace!  Solaris /bin/ln does not understand -f,
Packit 8dc392
	    # so we also need to try rm && ln -s.
Packit 8dc392
	    for linkname
Packit 8dc392
	    do
Packit 8dc392
	      test "$linkname" != "$realname" \
Packit 8dc392
		&& func_show_eval "(cd $destdir && { $LN_S -f $realname $linkname || { $RM $linkname && $LN_S $realname $linkname; }; })"
Packit 8dc392
	    done
Packit 8dc392
	  fi
Packit 8dc392
Packit 8dc392
	  # Do each command in the postinstall commands.
Packit 8dc392
	  lib="$destdir/$realname"
Packit 8dc392
	  func_execute_cmds "$postinstall_cmds" 'exit $?'
Packit 8dc392
	fi
Packit 8dc392
Packit 8dc392
	# Install the pseudo-library for information purposes.
Packit 8dc392
	func_basename "$file"
Packit 8dc392
	name="$func_basename_result"
Packit 8dc392
	instname="$dir/$name"i
Packit 8dc392
	func_show_eval "$install_prog $instname $destdir/$name" 'exit $?'
Packit 8dc392
Packit 8dc392
	# Maybe install the static library, too.
Packit 8dc392
	test -n "$old_library" && staticlibs="$staticlibs $dir/$old_library"
Packit 8dc392
	;;
Packit 8dc392
Packit 8dc392
      *.lo)
Packit 8dc392
	# Install (i.e. copy) a libtool object.
Packit 8dc392
Packit 8dc392
	# Figure out destination file name, if it wasn't already specified.
Packit 8dc392
	if test -n "$destname"; then
Packit 8dc392
	  destfile="$destdir/$destname"
Packit 8dc392
	else
Packit 8dc392
	  func_basename "$file"
Packit 8dc392
	  destfile="$func_basename_result"
Packit 8dc392
	  destfile="$destdir/$destfile"
Packit 8dc392
	fi
Packit 8dc392
Packit 8dc392
	# Deduce the name of the destination old-style object file.
Packit 8dc392
	case $destfile in
Packit 8dc392
	*.lo)
Packit 8dc392
	  func_lo2o "$destfile"
Packit 8dc392
	  staticdest=$func_lo2o_result
Packit 8dc392
	  ;;
Packit 8dc392
	*.$objext)
Packit 8dc392
	  staticdest="$destfile"
Packit 8dc392
	  destfile=
Packit 8dc392
	  ;;
Packit 8dc392
	*)
Packit 8dc392
	  func_fatal_help "cannot copy a libtool object to \`$destfile'"
Packit 8dc392
	  ;;
Packit 8dc392
	esac
Packit 8dc392
Packit 8dc392
	# Install the libtool object if requested.
Packit 8dc392
	test -n "$destfile" && \
Packit 8dc392
	  func_show_eval "$install_prog $file $destfile" 'exit $?'
Packit 8dc392
Packit 8dc392
	# Install the old object if enabled.
Packit 8dc392
	if test "$build_old_libs" = yes; then
Packit 8dc392
	  # Deduce the name of the old-style object file.
Packit 8dc392
	  func_lo2o "$file"
Packit 8dc392
	  staticobj=$func_lo2o_result
Packit 8dc392
	  func_show_eval "$install_prog \$staticobj \$staticdest" 'exit $?'
Packit 8dc392
	fi
Packit 8dc392
	exit $EXIT_SUCCESS
Packit 8dc392
	;;
Packit 8dc392
Packit 8dc392
      *)
Packit 8dc392
	# Figure out destination file name, if it wasn't already specified.
Packit 8dc392
	if test -n "$destname"; then
Packit 8dc392
	  destfile="$destdir/$destname"
Packit 8dc392
	else
Packit 8dc392
	  func_basename "$file"
Packit 8dc392
	  destfile="$func_basename_result"
Packit 8dc392
	  destfile="$destdir/$destfile"
Packit 8dc392
	fi
Packit 8dc392
Packit 8dc392
	# If the file is missing, and there is a .exe on the end, strip it
Packit 8dc392
	# because it is most likely a libtool script we actually want to
Packit 8dc392
	# install
Packit 8dc392
	stripped_ext=""
Packit 8dc392
	case $file in
Packit 8dc392
	  *.exe)
Packit 8dc392
	    if test ! -f "$file"; then
Packit 8dc392
	      func_stripname '' '.exe' "$file"
Packit 8dc392
	      file=$func_stripname_result
Packit 8dc392
	      stripped_ext=".exe"
Packit 8dc392
	    fi
Packit 8dc392
	    ;;
Packit 8dc392
	esac
Packit 8dc392
Packit 8dc392
	# Do a test to see if this is really a libtool program.
Packit 8dc392
	case $host in
Packit 8dc392
	*cygwin* | *mingw*)
Packit 8dc392
	    if func_ltwrapper_executable_p "$file"; then
Packit 8dc392
	      func_ltwrapper_scriptname "$file"
Packit 8dc392
	      wrapper=$func_ltwrapper_scriptname_result
Packit 8dc392
	    else
Packit 8dc392
	      func_stripname '' '.exe' "$file"
Packit 8dc392
	      wrapper=$func_stripname_result
Packit 8dc392
	    fi
Packit 8dc392
	    ;;
Packit 8dc392
	*)
Packit 8dc392
	    wrapper=$file
Packit 8dc392
	    ;;
Packit 8dc392
	esac
Packit 8dc392
	if func_ltwrapper_script_p "$wrapper"; then
Packit 8dc392
	  notinst_deplibs=
Packit 8dc392
	  relink_command=
Packit 8dc392
Packit 8dc392
	  func_source "$wrapper"
Packit 8dc392
Packit 8dc392
	  # Check the variables that should have been set.
Packit 8dc392
	  test -z "$generated_by_libtool_version" && \
Packit 8dc392
	    func_fatal_error "invalid libtool wrapper script \`$wrapper'"
Packit 8dc392
Packit 8dc392
	  finalize=yes
Packit 8dc392
	  for lib in $notinst_deplibs; do
Packit 8dc392
	    # Check to see that each library is installed.
Packit 8dc392
	    libdir=
Packit 8dc392
	    if test -f "$lib"; then
Packit 8dc392
	      func_source "$lib"
Packit 8dc392
	    fi
Packit 8dc392
	    libfile="$libdir/"`$ECHO "X$lib" | $Xsed -e 's%^.*/%%g'` ### testsuite: skip nested quoting test
Packit 8dc392
	    if test -n "$libdir" && test ! -f "$libfile"; then
Packit 8dc392
	      func_warning "\`$lib' has not been installed in \`$libdir'"
Packit 8dc392
	      finalize=no
Packit 8dc392
	    fi
Packit 8dc392
	  done
Packit 8dc392
Packit 8dc392
	  relink_command=
Packit 8dc392
	  func_source "$wrapper"
Packit 8dc392
Packit 8dc392
	  outputname=
Packit 8dc392
	  if test "$fast_install" = no && test -n "$relink_command"; then
Packit 8dc392
	    $opt_dry_run || {
Packit 8dc392
	      if test "$finalize" = yes; then
Packit 8dc392
	        tmpdir=`func_mktempdir`
Packit 8dc392
		func_basename "$file$stripped_ext"
Packit 8dc392
		file="$func_basename_result"
Packit 8dc392
	        outputname="$tmpdir/$file"
Packit 8dc392
	        # Replace the output file specification.
Packit 8dc392
	        relink_command=`$ECHO "X$relink_command" | $Xsed -e 's%@OUTPUT@%'"$outputname"'%g'`
Packit 8dc392
Packit 8dc392
	        $opt_silent || {
Packit 8dc392
	          func_quote_for_expand "$relink_command"
Packit 8dc392
		  eval "func_echo $func_quote_for_expand_result"
Packit 8dc392
	        }
Packit 8dc392
	        if eval "$relink_command"; then :
Packit 8dc392
	          else
Packit 8dc392
		  func_error "error: relink \`$file' with the above command before installing it"
Packit 8dc392
		  $opt_dry_run || ${RM}r "$tmpdir"
Packit 8dc392
		  continue
Packit 8dc392
	        fi
Packit 8dc392
	        file="$outputname"
Packit 8dc392
	      else
Packit 8dc392
	        func_warning "cannot relink \`$file'"
Packit 8dc392
	      fi
Packit 8dc392
	    }
Packit 8dc392
	  else
Packit 8dc392
	    # Install the binary that we compiled earlier.
Packit 8dc392
	    file=`$ECHO "X$file$stripped_ext" | $Xsed -e "s%\([^/]*\)$%$objdir/\1%"`
Packit 8dc392
	  fi
Packit 8dc392
	fi
Packit 8dc392
Packit 8dc392
	# remove .exe since cygwin /usr/bin/install will append another
Packit 8dc392
	# one anyway
Packit 8dc392
	case $install_prog,$host in
Packit 8dc392
	*/usr/bin/install*,*cygwin*)
Packit 8dc392
	  case $file:$destfile in
Packit 8dc392
	  *.exe:*.exe)
Packit 8dc392
	    # this is ok
Packit 8dc392
	    ;;
Packit 8dc392
	  *.exe:*)
Packit 8dc392
	    destfile=$destfile.exe
Packit 8dc392
	    ;;
Packit 8dc392
	  *:*.exe)
Packit 8dc392
	    func_stripname '' '.exe' "$destfile"
Packit 8dc392
	    destfile=$func_stripname_result
Packit 8dc392
	    ;;
Packit 8dc392
	  esac
Packit 8dc392
	  ;;
Packit 8dc392
	esac
Packit 8dc392
	func_show_eval "$install_prog\$stripme \$file \$destfile" 'exit $?'
Packit 8dc392
	$opt_dry_run || if test -n "$outputname"; then
Packit 8dc392
	  ${RM}r "$tmpdir"
Packit 8dc392
	fi
Packit 8dc392
	;;
Packit 8dc392
      esac
Packit 8dc392
    done
Packit 8dc392
Packit 8dc392
    for file in $staticlibs; do
Packit 8dc392
      func_basename "$file"
Packit 8dc392
      name="$func_basename_result"
Packit 8dc392
Packit 8dc392
      # Set up the ranlib parameters.
Packit 8dc392
      oldlib="$destdir/$name"
Packit 8dc392
Packit 8dc392
      func_show_eval "$install_prog \$file \$oldlib" 'exit $?'
Packit 8dc392
Packit 8dc392
      if test -n "$stripme" && test -n "$old_striplib"; then
Packit 8dc392
	func_show_eval "$old_striplib $oldlib" 'exit $?'
Packit 8dc392
      fi
Packit 8dc392
Packit 8dc392
      # Do each command in the postinstall commands.
Packit 8dc392
      func_execute_cmds "$old_postinstall_cmds" 'exit $?'
Packit 8dc392
    done
Packit 8dc392
Packit 8dc392
    test -n "$future_libdirs" && \
Packit 8dc392
      func_warning "remember to run \`$progname --finish$future_libdirs'"
Packit 8dc392
Packit 8dc392
    if test -n "$current_libdirs"; then
Packit 8dc392
      # Maybe just do a dry run.
Packit 8dc392
      $opt_dry_run && current_libdirs=" -n$current_libdirs"
Packit 8dc392
      exec_cmd='$SHELL $progpath $preserve_args --finish$current_libdirs'
Packit 8dc392
    else
Packit 8dc392
      exit $EXIT_SUCCESS
Packit 8dc392
    fi
Packit 8dc392
}
Packit 8dc392
Packit 8dc392
test "$mode" = install && func_mode_install ${1+"$@"}
Packit 8dc392
Packit 8dc392
Packit 8dc392
# func_generate_dlsyms outputname originator pic_p
Packit 8dc392
# Extract symbols from dlprefiles and create ${outputname}S.o with
Packit 8dc392
# a dlpreopen symbol table.
Packit 8dc392
func_generate_dlsyms ()
Packit 8dc392
{
Packit 8dc392
    $opt_debug
Packit 8dc392
    my_outputname="$1"
Packit 8dc392
    my_originator="$2"
Packit 8dc392
    my_pic_p="${3-no}"
Packit 8dc392
    my_prefix=`$ECHO "$my_originator" | sed 's%[^a-zA-Z0-9]%_%g'`
Packit 8dc392
    my_dlsyms=
Packit 8dc392
Packit 8dc392
    if test -n "$dlfiles$dlprefiles" || test "$dlself" != no; then
Packit 8dc392
      if test -n "$NM" && test -n "$global_symbol_pipe"; then
Packit 8dc392
	my_dlsyms="${my_outputname}S.c"
Packit 8dc392
      else
Packit 8dc392
	func_error "not configured to extract global symbols from dlpreopened files"
Packit 8dc392
      fi
Packit 8dc392
    fi
Packit 8dc392
Packit 8dc392
    if test -n "$my_dlsyms"; then
Packit 8dc392
      case $my_dlsyms in
Packit 8dc392
      "") ;;
Packit 8dc392
      *.c)
Packit 8dc392
	# Discover the nlist of each of the dlfiles.
Packit 8dc392
	nlist="$output_objdir/${my_outputname}.nm"
Packit 8dc392
Packit 8dc392
	func_show_eval "$RM $nlist ${nlist}S ${nlist}T"
Packit 8dc392
Packit 8dc392
	# Parse the name list into a source file.
Packit 8dc392
	func_verbose "creating $output_objdir/$my_dlsyms"
Packit 8dc392
Packit 8dc392
	$opt_dry_run || $ECHO > "$output_objdir/$my_dlsyms" "\
Packit 8dc392
/* $my_dlsyms - symbol resolution table for \`$my_outputname' dlsym emulation. */
Packit 8dc392
/* Generated by $PROGRAM (GNU $PACKAGE$TIMESTAMP) $VERSION */
Packit 8dc392
Packit 8dc392
#ifdef __cplusplus
Packit 8dc392
extern \"C\" {
Packit 8dc392
#endif
Packit 8dc392
Packit 8dc392
/* External symbol declarations for the compiler. */\
Packit 8dc392
"
Packit 8dc392
Packit 8dc392
	if test "$dlself" = yes; then
Packit 8dc392
	  func_verbose "generating symbol list for \`$output'"
Packit 8dc392
Packit 8dc392
	  $opt_dry_run || echo ': @PROGRAM@ ' > "$nlist"
Packit 8dc392
Packit 8dc392
	  # Add our own program objects to the symbol list.
Packit 8dc392
	  progfiles=`$ECHO "X$objs$old_deplibs" | $SP2NL | $Xsed -e "$lo2o" | $NL2SP`
Packit 8dc392
	  for progfile in $progfiles; do
Packit 8dc392
	    func_verbose "extracting global C symbols from \`$progfile'"
Packit 8dc392
	    $opt_dry_run || eval "$NM $progfile | $global_symbol_pipe >> '$nlist'"
Packit 8dc392
	  done
Packit 8dc392
Packit 8dc392
	  if test -n "$exclude_expsyms"; then
Packit 8dc392
	    $opt_dry_run || {
Packit 8dc392
	      eval '$EGREP -v " ($exclude_expsyms)$" "$nlist" > "$nlist"T'
Packit 8dc392
	      eval '$MV "$nlist"T "$nlist"'
Packit 8dc392
	    }
Packit 8dc392
	  fi
Packit 8dc392
Packit 8dc392
	  if test -n "$export_symbols_regex"; then
Packit 8dc392
	    $opt_dry_run || {
Packit 8dc392
	      eval '$EGREP -e "$export_symbols_regex" "$nlist" > "$nlist"T'
Packit 8dc392
	      eval '$MV "$nlist"T "$nlist"'
Packit 8dc392
	    }
Packit 8dc392
	  fi
Packit 8dc392
Packit 8dc392
	  # Prepare the list of exported symbols
Packit 8dc392
	  if test -z "$export_symbols"; then
Packit 8dc392
	    export_symbols="$output_objdir/$outputname.exp"
Packit 8dc392
	    $opt_dry_run || {
Packit 8dc392
	      $RM $export_symbols
Packit 8dc392
	      eval "${SED} -n -e '/^: @PROGRAM@ $/d' -e 's/^.* \(.*\)$/\1/p' "'< "$nlist" > "$export_symbols"'
Packit 8dc392
	      case $host in
Packit 8dc392
	      *cygwin* | *mingw* | *cegcc* )
Packit 8dc392
                eval "echo EXPORTS "'> "$output_objdir/$outputname.def"'
Packit 8dc392
                eval 'cat "$export_symbols" >> "$output_objdir/$outputname.def"'
Packit 8dc392
	        ;;
Packit 8dc392
	      esac
Packit 8dc392
	    }
Packit 8dc392
	  else
Packit 8dc392
	    $opt_dry_run || {
Packit 8dc392
	      eval "${SED} -e 's/\([].[*^$]\)/\\\\\1/g' -e 's/^/ /' -e 's/$/$/'"' < "$export_symbols" > "$output_objdir/$outputname.exp"'
Packit 8dc392
	      eval '$GREP -f "$output_objdir/$outputname.exp" < "$nlist" > "$nlist"T'
Packit 8dc392
	      eval '$MV "$nlist"T "$nlist"'
Packit 8dc392
	      case $host in
Packit 8dc392
	        *cygwin | *mingw* | *cegcc* )
Packit 8dc392
	          eval "echo EXPORTS "'> "$output_objdir/$outputname.def"'
Packit 8dc392
	          eval 'cat "$nlist" >> "$output_objdir/$outputname.def"'
Packit 8dc392
	          ;;
Packit 8dc392
	      esac
Packit 8dc392
	    }
Packit 8dc392
	  fi
Packit 8dc392
	fi
Packit 8dc392
Packit 8dc392
	for dlprefile in $dlprefiles; do
Packit 8dc392
	  func_verbose "extracting global C symbols from \`$dlprefile'"
Packit 8dc392
	  func_basename "$dlprefile"
Packit 8dc392
	  name="$func_basename_result"
Packit 8dc392
	  $opt_dry_run || {
Packit 8dc392
	    eval '$ECHO ": $name " >> "$nlist"'
Packit 8dc392
	    eval "$NM $dlprefile 2>/dev/null | $global_symbol_pipe >> '$nlist'"
Packit 8dc392
	  }
Packit 8dc392
	done
Packit 8dc392
Packit 8dc392
	$opt_dry_run || {
Packit 8dc392
	  # Make sure we have at least an empty file.
Packit 8dc392
	  test -f "$nlist" || : > "$nlist"
Packit 8dc392
Packit 8dc392
	  if test -n "$exclude_expsyms"; then
Packit 8dc392
	    $EGREP -v " ($exclude_expsyms)$" "$nlist" > "$nlist"T
Packit 8dc392
	    $MV "$nlist"T "$nlist"
Packit 8dc392
	  fi
Packit 8dc392
Packit 8dc392
	  # Try sorting and uniquifying the output.
Packit 8dc392
	  if $GREP -v "^: " < "$nlist" |
Packit 8dc392
	      if sort -k 3 </dev/null >/dev/null 2>&1; then
Packit 8dc392
		sort -k 3
Packit 8dc392
	      else
Packit 8dc392
		sort +2
Packit 8dc392
	      fi |
Packit 8dc392
	      uniq > "$nlist"S; then
Packit 8dc392
	    :
Packit 8dc392
	  else
Packit 8dc392
	    $GREP -v "^: " < "$nlist" > "$nlist"S
Packit 8dc392
	  fi
Packit 8dc392
Packit 8dc392
	  if test -f "$nlist"S; then
Packit 8dc392
	    eval "$global_symbol_to_cdecl"' < "$nlist"S >> "$output_objdir/$my_dlsyms"'
Packit 8dc392
	  else
Packit 8dc392
	    $ECHO '/* NONE */' >> "$output_objdir/$my_dlsyms"
Packit 8dc392
	  fi
Packit 8dc392
Packit 8dc392
	  $ECHO >> "$output_objdir/$my_dlsyms" "\
Packit 8dc392
Packit 8dc392
/* The mapping between symbol names and symbols.  */
Packit 8dc392
typedef struct {
Packit 8dc392
  const char *name;
Packit 8dc392
  void *address;
Packit 8dc392
} lt_dlsymlist;
Packit 8dc392
"
Packit 8dc392
	  case $host in
Packit 8dc392
	  *cygwin* | *mingw* | *cegcc* )
Packit 8dc392
	    $ECHO >> "$output_objdir/$my_dlsyms" "\
Packit 8dc392
/* DATA imports from DLLs on WIN32 con't be const, because
Packit 8dc392
   runtime relocations are performed -- see ld's documentation
Packit 8dc392
   on pseudo-relocs.  */"
Packit 8dc392
	    lt_dlsym_const= ;;
Packit 8dc392
	  *osf5*)
Packit 8dc392
	    echo >> "$output_objdir/$my_dlsyms" "\
Packit 8dc392
/* This system does not cope well with relocations in const data */"
Packit 8dc392
	    lt_dlsym_const= ;;
Packit 8dc392
	  *)
Packit 8dc392
	    lt_dlsym_const=const ;;
Packit 8dc392
	  esac
Packit 8dc392
Packit 8dc392
	  $ECHO >> "$output_objdir/$my_dlsyms" "\
Packit 8dc392
extern $lt_dlsym_const lt_dlsymlist
Packit 8dc392
lt_${my_prefix}_LTX_preloaded_symbols[];
Packit 8dc392
$lt_dlsym_const lt_dlsymlist
Packit 8dc392
lt_${my_prefix}_LTX_preloaded_symbols[] =
Packit 8dc392
{\
Packit 8dc392
  { \"$my_originator\", (void *) 0 },"
Packit 8dc392
Packit 8dc392
	  case $need_lib_prefix in
Packit 8dc392
	  no)
Packit 8dc392
	    eval "$global_symbol_to_c_name_address" < "$nlist" >> "$output_objdir/$my_dlsyms"
Packit 8dc392
	    ;;
Packit 8dc392
	  *)
Packit 8dc392
	    eval "$global_symbol_to_c_name_address_lib_prefix" < "$nlist" >> "$output_objdir/$my_dlsyms"
Packit 8dc392
	    ;;
Packit 8dc392
	  esac
Packit 8dc392
	  $ECHO >> "$output_objdir/$my_dlsyms" "\
Packit 8dc392
  {0, (void *) 0}
Packit 8dc392
};
Packit 8dc392
Packit 8dc392
/* This works around a problem in FreeBSD linker */
Packit 8dc392
#ifdef FREEBSD_WORKAROUND
Packit 8dc392
static const void *lt_preloaded_setup() {
Packit 8dc392
  return lt_${my_prefix}_LTX_preloaded_symbols;
Packit 8dc392
}
Packit 8dc392
#endif
Packit 8dc392
Packit 8dc392
#ifdef __cplusplus
Packit 8dc392
}
Packit 8dc392
#endif\
Packit 8dc392
"
Packit 8dc392
	} # !$opt_dry_run
Packit 8dc392
Packit 8dc392
	pic_flag_for_symtable=
Packit 8dc392
	case "$compile_command " in
Packit 8dc392
	*" -static "*) ;;
Packit 8dc392
	*)
Packit 8dc392
	  case $host in
Packit 8dc392
	  # compiling the symbol table file with pic_flag works around
Packit 8dc392
	  # a FreeBSD bug that causes programs to crash when -lm is
Packit 8dc392
	  # linked before any other PIC object.  But we must not use
Packit 8dc392
	  # pic_flag when linking with -static.  The problem exists in
Packit 8dc392
	  # FreeBSD 2.2.6 and is fixed in FreeBSD 3.1.
Packit 8dc392
	  *-*-freebsd2*|*-*-freebsd3.0*|*-*-freebsdelf3.0*)
Packit 8dc392
	    pic_flag_for_symtable=" $pic_flag -DFREEBSD_WORKAROUND" ;;
Packit 8dc392
	  *-*-hpux*)
Packit 8dc392
	    pic_flag_for_symtable=" $pic_flag"  ;;
Packit 8dc392
	  *)
Packit 8dc392
	    if test "X$my_pic_p" != Xno; then
Packit 8dc392
	      pic_flag_for_symtable=" $pic_flag"
Packit 8dc392
	    fi
Packit 8dc392
	    ;;
Packit 8dc392
	  esac
Packit 8dc392
	  ;;
Packit 8dc392
	esac
Packit 8dc392
	symtab_cflags=
Packit 8dc392
	for arg in $LTCFLAGS; do
Packit 8dc392
	  case $arg in
Packit 8dc392
	  -pie | -fpie | -fPIE) ;;
Packit 8dc392
	  *) symtab_cflags="$symtab_cflags $arg" ;;
Packit 8dc392
	  esac
Packit 8dc392
	done
Packit 8dc392
Packit 8dc392
	# Now compile the dynamic symbol file.
Packit 8dc392
	func_show_eval '(cd $output_objdir && $LTCC$symtab_cflags -c$no_builtin_flag$pic_flag_for_symtable "$my_dlsyms")' 'exit $?'
Packit 8dc392
Packit 8dc392
	# Clean up the generated files.
Packit 8dc392
	func_show_eval '$RM "$output_objdir/$my_dlsyms" "$nlist" "${nlist}S" "${nlist}T"'
Packit 8dc392
Packit 8dc392
	# Transform the symbol file into the correct name.
Packit 8dc392
	symfileobj="$output_objdir/${my_outputname}S.$objext"
Packit 8dc392
	case $host in
Packit 8dc392
	*cygwin* | *mingw* | *cegcc* )
Packit 8dc392
	  if test -f "$output_objdir/$my_outputname.def"; then
Packit 8dc392
	    compile_command=`$ECHO "X$compile_command" | $Xsed -e "s%@SYMFILE@%$output_objdir/$my_outputname.def $symfileobj%"`
Packit 8dc392
	    finalize_command=`$ECHO "X$finalize_command" | $Xsed -e "s%@SYMFILE@%$output_objdir/$my_outputname.def $symfileobj%"`
Packit 8dc392
	  else
Packit 8dc392
	    compile_command=`$ECHO "X$compile_command" | $Xsed -e "s%@SYMFILE@%$symfileobj%"`
Packit 8dc392
	    finalize_command=`$ECHO "X$finalize_command" | $Xsed -e "s%@SYMFILE@%$symfileobj%"`
Packit 8dc392
	  fi
Packit 8dc392
	  ;;
Packit 8dc392
	*)
Packit 8dc392
	  compile_command=`$ECHO "X$compile_command" | $Xsed -e "s%@SYMFILE@%$symfileobj%"`
Packit 8dc392
	  finalize_command=`$ECHO "X$finalize_command" | $Xsed -e "s%@SYMFILE@%$symfileobj%"`
Packit 8dc392
	  ;;
Packit 8dc392
	esac
Packit 8dc392
	;;
Packit 8dc392
      *)
Packit 8dc392
	func_fatal_error "unknown suffix for \`$my_dlsyms'"
Packit 8dc392
	;;
Packit 8dc392
      esac
Packit 8dc392
    else
Packit 8dc392
      # We keep going just in case the user didn't refer to
Packit 8dc392
      # lt_preloaded_symbols.  The linker will fail if global_symbol_pipe
Packit 8dc392
      # really was required.
Packit 8dc392
Packit 8dc392
      # Nullify the symbol file.
Packit 8dc392
      compile_command=`$ECHO "X$compile_command" | $Xsed -e "s% @SYMFILE@%%"`
Packit 8dc392
      finalize_command=`$ECHO "X$finalize_command" | $Xsed -e "s% @SYMFILE@%%"`
Packit 8dc392
    fi
Packit 8dc392
}
Packit 8dc392
Packit 8dc392
# func_win32_libid arg
Packit 8dc392
# return the library type of file 'arg'
Packit 8dc392
#
Packit 8dc392
# Need a lot of goo to handle *both* DLLs and import libs
Packit 8dc392
# Has to be a shell function in order to 'eat' the argument
Packit 8dc392
# that is supplied when $file_magic_command is called.
Packit 8dc392
func_win32_libid ()
Packit 8dc392
{
Packit 8dc392
  $opt_debug
Packit 8dc392
  win32_libid_type="unknown"
Packit 8dc392
  win32_fileres=`file -L $1 2>/dev/null`
Packit 8dc392
  case $win32_fileres in
Packit 8dc392
  *ar\ archive\ import\ library*) # definitely import
Packit 8dc392
    win32_libid_type="x86 archive import"
Packit 8dc392
    ;;
Packit 8dc392
  *ar\ archive*) # could be an import, or static
Packit 8dc392
    if eval $OBJDUMP -f $1 | $SED -e '10q' 2>/dev/null |
Packit 8dc392
       $EGREP 'file format pe-i386(.*architecture: i386)?' >/dev/null ; then
Packit 8dc392
      win32_nmres=`eval $NM -f posix -A $1 |
Packit 8dc392
	$SED -n -e '
Packit 8dc392
	    1,100{
Packit 8dc392
		/ I /{
Packit 8dc392
		    s,.*,import,
Packit 8dc392
		    p
Packit 8dc392
		    q
Packit 8dc392
		}
Packit 8dc392
	    }'`
Packit 8dc392
      case $win32_nmres in
Packit 8dc392
      import*)  win32_libid_type="x86 archive import";;
Packit 8dc392
      *)        win32_libid_type="x86 archive static";;
Packit 8dc392
      esac
Packit 8dc392
    fi
Packit 8dc392
    ;;
Packit 8dc392
  *DLL*)
Packit 8dc392
    win32_libid_type="x86 DLL"
Packit 8dc392
    ;;
Packit 8dc392
  *executable*) # but shell scripts are "executable" too...
Packit 8dc392
    case $win32_fileres in
Packit 8dc392
    *MS\ Windows\ PE\ Intel*)
Packit 8dc392
      win32_libid_type="x86 DLL"
Packit 8dc392
      ;;
Packit 8dc392
    esac
Packit 8dc392
    ;;
Packit 8dc392
  esac
Packit 8dc392
  $ECHO "$win32_libid_type"
Packit 8dc392
}
Packit 8dc392
Packit 8dc392
Packit 8dc392
Packit 8dc392
# func_extract_an_archive dir oldlib
Packit 8dc392
func_extract_an_archive ()
Packit 8dc392
{
Packit 8dc392
    $opt_debug
Packit 8dc392
    f_ex_an_ar_dir="$1"; shift
Packit 8dc392
    f_ex_an_ar_oldlib="$1"
Packit 8dc392
    func_show_eval "(cd \$f_ex_an_ar_dir && $AR x \"\$f_ex_an_ar_oldlib\")" 'exit $?'
Packit 8dc392
    if ($AR t "$f_ex_an_ar_oldlib" | sort | sort -uc >/dev/null 2>&1;; then
Packit 8dc392
     :
Packit 8dc392
    else
Packit 8dc392
      func_fatal_error "object name conflicts in archive: $f_ex_an_ar_dir/$f_ex_an_ar_oldlib"
Packit 8dc392
    fi
Packit 8dc392
}
Packit 8dc392
Packit 8dc392
Packit 8dc392
# func_extract_archives gentop oldlib ...
Packit 8dc392
func_extract_archives ()
Packit 8dc392
{
Packit 8dc392
    $opt_debug
Packit 8dc392
    my_gentop="$1"; shift
Packit 8dc392
    my_oldlibs=${1+"$@"}
Packit 8dc392
    my_oldobjs=""
Packit 8dc392
    my_xlib=""
Packit 8dc392
    my_xabs=""
Packit 8dc392
    my_xdir=""
Packit 8dc392
Packit 8dc392
    for my_xlib in $my_oldlibs; do
Packit 8dc392
      # Extract the objects.
Packit 8dc392
      case $my_xlib in
Packit 8dc392
	[\\/]* | [A-Za-z]:[\\/]*) my_xabs="$my_xlib" ;;
Packit 8dc392
	*) my_xabs=`pwd`"/$my_xlib" ;;
Packit 8dc392
      esac
Packit 8dc392
      func_basename "$my_xlib"
Packit 8dc392
      my_xlib="$func_basename_result"
Packit 8dc392
      my_xlib_u=$my_xlib
Packit 8dc392
      while :; do
Packit 8dc392
        case " $extracted_archives " in
Packit 8dc392
	*" $my_xlib_u "*)
Packit 8dc392
	  func_arith $extracted_serial + 1
Packit 8dc392
	  extracted_serial=$func_arith_result
Packit 8dc392
	  my_xlib_u=lt$extracted_serial-$my_xlib ;;
Packit 8dc392
	*) break ;;
Packit 8dc392
	esac
Packit 8dc392
      done
Packit 8dc392
      extracted_archives="$extracted_archives $my_xlib_u"
Packit 8dc392
      my_xdir="$my_gentop/$my_xlib_u"
Packit 8dc392
Packit 8dc392
      func_mkdir_p "$my_xdir"
Packit 8dc392
Packit 8dc392
      case $host in
Packit 8dc392
      *-darwin*)
Packit 8dc392
	func_verbose "Extracting $my_xabs"
Packit 8dc392
	# Do not bother doing anything if just a dry run
Packit 8dc392
	$opt_dry_run || {
Packit 8dc392
	  darwin_orig_dir=`pwd`
Packit 8dc392
	  cd $my_xdir || exit $?
Packit 8dc392
	  darwin_archive=$my_xabs
Packit 8dc392
	  darwin_curdir=`pwd`
Packit 8dc392
	  darwin_base_archive=`basename "$darwin_archive"`
Packit 8dc392
	  darwin_arches=`$LIPO -info "$darwin_archive" 2>/dev/null | $GREP Architectures 2>/dev/null || true`
Packit 8dc392
	  if test -n "$darwin_arches"; then
Packit 8dc392
	    darwin_arches=`$ECHO "$darwin_arches" | $SED -e 's/.*are://'`
Packit 8dc392
	    darwin_arch=
Packit 8dc392
	    func_verbose "$darwin_base_archive has multiple architectures $darwin_arches"
Packit 8dc392
	    for darwin_arch in  $darwin_arches ; do
Packit 8dc392
	      func_mkdir_p "unfat-$$/${darwin_base_archive}-${darwin_arch}"
Packit 8dc392
	      $LIPO -thin $darwin_arch -output "unfat-$$/${darwin_base_archive}-${darwin_arch}/${darwin_base_archive}" "${darwin_archive}"
Packit 8dc392
	      cd "unfat-$$/${darwin_base_archive}-${darwin_arch}"
Packit 8dc392
	      func_extract_an_archive "`pwd`" "${darwin_base_archive}"
Packit 8dc392
	      cd "$darwin_curdir"
Packit 8dc392
	      $RM "unfat-$$/${darwin_base_archive}-${darwin_arch}/${darwin_base_archive}"
Packit 8dc392
	    done # $darwin_arches
Packit 8dc392
            ## Okay now we've a bunch of thin objects, gotta fatten them up :)
Packit 8dc392
	    darwin_filelist=`find unfat-$$ -type f -name \*.o -print -o -name \*.lo -print | $SED -e "$basename" | sort -u`
Packit 8dc392
	    darwin_file=
Packit 8dc392
	    darwin_files=
Packit 8dc392
	    for darwin_file in $darwin_filelist; do
Packit 8dc392
	      darwin_files=`find unfat-$$ -name $darwin_file -print | $NL2SP`
Packit 8dc392
	      $LIPO -create -output "$darwin_file" $darwin_files
Packit 8dc392
	    done # $darwin_filelist
Packit 8dc392
	    $RM -rf unfat-$$
Packit 8dc392
	    cd "$darwin_orig_dir"
Packit 8dc392
	  else
Packit 8dc392
	    cd $darwin_orig_dir
Packit 8dc392
	    func_extract_an_archive "$my_xdir" "$my_xabs"
Packit 8dc392
	  fi # $darwin_arches
Packit 8dc392
	} # !$opt_dry_run
Packit 8dc392
	;;
Packit 8dc392
      *)
Packit 8dc392
        func_extract_an_archive "$my_xdir" "$my_xabs"
Packit 8dc392
	;;
Packit 8dc392
      esac
Packit 8dc392
      my_oldobjs="$my_oldobjs "`find $my_xdir -name \*.$objext -print -o -name \*.lo -print | $NL2SP`
Packit 8dc392
    done
Packit 8dc392
Packit 8dc392
    func_extract_archives_result="$my_oldobjs"
Packit 8dc392
}
Packit 8dc392
Packit 8dc392
Packit 8dc392
Packit 8dc392
# func_emit_wrapper_part1 [arg=no]
Packit 8dc392
#
Packit 8dc392
# Emit the first part of a libtool wrapper script on stdout.
Packit 8dc392
# For more information, see the description associated with
Packit 8dc392
# func_emit_wrapper(), below.
Packit 8dc392
func_emit_wrapper_part1 ()
Packit 8dc392
{
Packit 8dc392
	func_emit_wrapper_part1_arg1=no
Packit 8dc392
	if test -n "$1" ; then
Packit 8dc392
	  func_emit_wrapper_part1_arg1=$1
Packit 8dc392
	fi
Packit 8dc392
Packit 8dc392
	$ECHO "\
Packit 8dc392
#! $SHELL
Packit 8dc392
Packit 8dc392
# $output - temporary wrapper script for $objdir/$outputname
Packit 8dc392
# Generated by $PROGRAM (GNU $PACKAGE$TIMESTAMP) $VERSION
Packit 8dc392
#
Packit 8dc392
# The $output program cannot be directly executed until all the libtool
Packit 8dc392
# libraries that it depends on are installed.
Packit 8dc392
#
Packit 8dc392
# This wrapper script should never be moved out of the build directory.
Packit 8dc392
# If it is, it will not operate correctly.
Packit 8dc392
Packit 8dc392
# Sed substitution that helps us do robust quoting.  It backslashifies
Packit 8dc392
# metacharacters that are still active within double-quoted strings.
Packit 8dc392
Xsed='${SED} -e 1s/^X//'
Packit 8dc392
sed_quote_subst='$sed_quote_subst'
Packit 8dc392
Packit 8dc392
# Be Bourne compatible
Packit 8dc392
if test -n \"\${ZSH_VERSION+set}\" && (emulate sh) >/dev/null 2>&1; then
Packit 8dc392
  emulate sh
Packit 8dc392
  NULLCMD=:
Packit 8dc392
  # Zsh 3.x and 4.x performs word splitting on \${1+\"\$@\"}, which
Packit 8dc392
  # is contrary to our usage.  Disable this feature.
Packit 8dc392
  alias -g '\${1+\"\$@\"}'='\"\$@\"'
Packit 8dc392
  setopt NO_GLOB_SUBST
Packit 8dc392
else
Packit 8dc392
  case \`(set -o) 2>/dev/null\` in *posix*) set -o posix;; esac
Packit 8dc392
fi
Packit 8dc392
BIN_SH=xpg4; export BIN_SH # for Tru64
Packit 8dc392
DUALCASE=1; export DUALCASE # for MKS sh
Packit 8dc392
Packit 8dc392
# The HP-UX ksh and POSIX shell print the target directory to stdout
Packit 8dc392
# if CDPATH is set.
Packit 8dc392
(unset CDPATH) >/dev/null 2>&1 && unset CDPATH
Packit 8dc392
Packit 8dc392
relink_command=\"$relink_command\"
Packit 8dc392
Packit 8dc392
# This environment variable determines our operation mode.
Packit 8dc392
if test \"\$libtool_install_magic\" = \"$magic\"; then
Packit 8dc392
  # install mode needs the following variables:
Packit 8dc392
  generated_by_libtool_version='$macro_version'
Packit 8dc392
  notinst_deplibs='$notinst_deplibs'
Packit 8dc392
else
Packit 8dc392
  # When we are sourced in execute mode, \$file and \$ECHO are already set.
Packit 8dc392
  if test \"\$libtool_execute_magic\" != \"$magic\"; then
Packit 8dc392
    ECHO=\"$qecho\"
Packit 8dc392
    file=\"\$0\"
Packit 8dc392
    # Make sure echo works.
Packit 8dc392
    if test \"X\$1\" = X--no-reexec; then
Packit 8dc392
      # Discard the --no-reexec flag, and continue.
Packit 8dc392
      shift
Packit 8dc392
    elif test \"X\`{ \$ECHO '\t'; } 2>/dev/null\`\" = 'X\t'; then
Packit 8dc392
      # Yippee, \$ECHO works!
Packit 8dc392
      :
Packit 8dc392
    else
Packit 8dc392
      # Restart under the correct shell, and then maybe \$ECHO will work.
Packit 8dc392
      exec $SHELL \"\$0\" --no-reexec \${1+\"\$@\"}
Packit 8dc392
    fi
Packit 8dc392
  fi\
Packit 8dc392
"
Packit 8dc392
	$ECHO "\
Packit 8dc392
Packit 8dc392
  # Find the directory that this script lives in.
Packit 8dc392
  thisdir=\`\$ECHO \"X\$file\" | \$Xsed -e 's%/[^/]*$%%'\`
Packit 8dc392
  test \"x\$thisdir\" = \"x\$file\" && thisdir=.
Packit 8dc392
Packit 8dc392
  # Follow symbolic links until we get to the real thisdir.
Packit 8dc392
  file=\`ls -ld \"\$file\" | ${SED} -n 's/.*-> //p'\`
Packit 8dc392
  while test -n \"\$file\"; do
Packit 8dc392
    destdir=\`\$ECHO \"X\$file\" | \$Xsed -e 's%/[^/]*\$%%'\`
Packit 8dc392
Packit 8dc392
    # If there was a directory component, then change thisdir.
Packit 8dc392
    if test \"x\$destdir\" != \"x\$file\"; then
Packit 8dc392
      case \"\$destdir\" in
Packit 8dc392
      [\\\\/]* | [A-Za-z]:[\\\\/]*) thisdir=\"\$destdir\" ;;
Packit 8dc392
      *) thisdir=\"\$thisdir/\$destdir\" ;;
Packit 8dc392
      esac
Packit 8dc392
    fi
Packit 8dc392
Packit 8dc392
    file=\`\$ECHO \"X\$file\" | \$Xsed -e 's%^.*/%%'\`
Packit 8dc392
    file=\`ls -ld \"\$thisdir/\$file\" | ${SED} -n 's/.*-> //p'\`
Packit 8dc392
  done
Packit 8dc392
"
Packit 8dc392
}
Packit 8dc392
# end: func_emit_wrapper_part1
Packit 8dc392
Packit 8dc392
# func_emit_wrapper_part2 [arg=no]
Packit 8dc392
#
Packit 8dc392
# Emit the second part of a libtool wrapper script on stdout.
Packit 8dc392
# For more information, see the description associated with
Packit 8dc392
# func_emit_wrapper(), below.
Packit 8dc392
func_emit_wrapper_part2 ()
Packit 8dc392
{
Packit 8dc392
	func_emit_wrapper_part2_arg1=no
Packit 8dc392
	if test -n "$1" ; then
Packit 8dc392
	  func_emit_wrapper_part2_arg1=$1
Packit 8dc392
	fi
Packit 8dc392
Packit 8dc392
	$ECHO "\
Packit 8dc392
Packit 8dc392
  # Usually 'no', except on cygwin/mingw when embedded into
Packit 8dc392
  # the cwrapper.
Packit 8dc392
  WRAPPER_SCRIPT_BELONGS_IN_OBJDIR=$func_emit_wrapper_part2_arg1
Packit 8dc392
  if test \"\$WRAPPER_SCRIPT_BELONGS_IN_OBJDIR\" = \"yes\"; then
Packit 8dc392
    # special case for '.'
Packit 8dc392
    if test \"\$thisdir\" = \".\"; then
Packit 8dc392
      thisdir=\`pwd\`
Packit 8dc392
    fi
Packit 8dc392
    # remove .libs from thisdir
Packit 8dc392
    case \"\$thisdir\" in
Packit 8dc392
    *[\\\\/]$objdir ) thisdir=\`\$ECHO \"X\$thisdir\" | \$Xsed -e 's%[\\\\/][^\\\\/]*$%%'\` ;;
Packit 8dc392
    $objdir )   thisdir=. ;;
Packit 8dc392
    esac
Packit 8dc392
  fi
Packit 8dc392
Packit 8dc392
  # Try to get the absolute directory name.
Packit 8dc392
  absdir=\`cd \"\$thisdir\" && pwd\`
Packit 8dc392
  test -n \"\$absdir\" && thisdir=\"\$absdir\"
Packit 8dc392
"
Packit 8dc392
Packit 8dc392
	if test "$fast_install" = yes; then
Packit 8dc392
	  $ECHO "\
Packit 8dc392
  program=lt-'$outputname'$exeext
Packit 8dc392
  progdir=\"\$thisdir/$objdir\"
Packit 8dc392
Packit 8dc392
  if test ! -f \"\$progdir/\$program\" ||
Packit 8dc392
     { file=\`ls -1dt \"\$progdir/\$program\" \"\$progdir/../\$program\" 2>/dev/null | ${SED} 1q\`; \\
Packit 8dc392
       test \"X\$file\" != \"X\$progdir/\$program\"; }; then
Packit 8dc392
Packit 8dc392
    file=\"\$\$-\$program\"
Packit 8dc392
Packit 8dc392
    if test ! -d \"\$progdir\"; then
Packit 8dc392
      $MKDIR \"\$progdir\"
Packit 8dc392
    else
Packit 8dc392
      $RM \"\$progdir/\$file\"
Packit 8dc392
    fi"
Packit 8dc392
Packit 8dc392
	  $ECHO "\
Packit 8dc392
Packit 8dc392
    # relink executable if necessary
Packit 8dc392
    if test -n \"\$relink_command\"; then
Packit 8dc392
      if relink_command_output=\`eval \$relink_command 2>&1\`; then :
Packit 8dc392
      else
Packit 8dc392
	$ECHO \"\$relink_command_output\" >&2
Packit 8dc392
	$RM \"\$progdir/\$file\"
Packit 8dc392
	exit 1
Packit 8dc392
      fi
Packit 8dc392
    fi
Packit 8dc392
Packit 8dc392
    $MV \"\$progdir/\$file\" \"\$progdir/\$program\" 2>/dev/null ||
Packit 8dc392
    { $RM \"\$progdir/\$program\";
Packit 8dc392
      $MV \"\$progdir/\$file\" \"\$progdir/\$program\"; }
Packit 8dc392
    $RM \"\$progdir/\$file\"
Packit 8dc392
  fi"
Packit 8dc392
	else
Packit 8dc392
	  $ECHO "\
Packit 8dc392
  program='$outputname'
Packit 8dc392
  progdir=\"\$thisdir/$objdir\"
Packit 8dc392
"
Packit 8dc392
	fi
Packit 8dc392
Packit 8dc392
	$ECHO "\
Packit 8dc392
Packit 8dc392
  if test -f \"\$progdir/\$program\"; then"
Packit 8dc392
Packit 8dc392
	# Export our shlibpath_var if we have one.
Packit 8dc392
	if test "$shlibpath_overrides_runpath" = yes && test -n "$shlibpath_var" && test -n "$temp_rpath"; then
Packit 8dc392
	  $ECHO "\
Packit 8dc392
    # Add our own library path to $shlibpath_var
Packit 8dc392
    $shlibpath_var=\"$temp_rpath\$$shlibpath_var\"
Packit 8dc392
Packit 8dc392
    # Some systems cannot cope with colon-terminated $shlibpath_var
Packit 8dc392
    # The second colon is a workaround for a bug in BeOS R4 sed
Packit 8dc392
    $shlibpath_var=\`\$ECHO \"X\$$shlibpath_var\" | \$Xsed -e 's/::*\$//'\`
Packit 8dc392
Packit 8dc392
    export $shlibpath_var
Packit 8dc392
"
Packit 8dc392
	fi
Packit 8dc392
Packit 8dc392
	# fixup the dll searchpath if we need to.
Packit 8dc392
	if test -n "$dllsearchpath"; then
Packit 8dc392
	  $ECHO "\
Packit 8dc392
    # Add the dll search path components to the executable PATH
Packit 8dc392
    PATH=$dllsearchpath:\$PATH
Packit 8dc392
"
Packit 8dc392
	fi
Packit 8dc392
Packit 8dc392
	$ECHO "\
Packit 8dc392
    if test \"\$libtool_execute_magic\" != \"$magic\"; then
Packit 8dc392
      # Run the actual program with our arguments.
Packit 8dc392
"
Packit 8dc392
	case $host in
Packit 8dc392
	# Backslashes separate directories on plain windows
Packit 8dc392
	*-*-mingw | *-*-os2* | *-cegcc*)
Packit 8dc392
	  $ECHO "\
Packit 8dc392
      exec \"\$progdir\\\\\$program\" \${1+\"\$@\"}
Packit 8dc392
"
Packit 8dc392
	  ;;
Packit 8dc392
Packit 8dc392
	*)
Packit 8dc392
	  $ECHO "\
Packit 8dc392
      exec \"\$progdir/\$program\" \${1+\"\$@\"}
Packit 8dc392
"
Packit 8dc392
	  ;;
Packit 8dc392
	esac
Packit 8dc392
	$ECHO "\
Packit 8dc392
      \$ECHO \"\$0: cannot exec \$program \$*\" 1>&2
Packit 8dc392
      exit 1
Packit 8dc392
    fi
Packit 8dc392
  else
Packit 8dc392
    # The program doesn't exist.
Packit 8dc392
    \$ECHO \"\$0: error: \\\`\$progdir/\$program' does not exist\" 1>&2
Packit 8dc392
    \$ECHO \"This script is just a wrapper for \$program.\" 1>&2
Packit 8dc392
    $ECHO \"See the $PACKAGE documentation for more information.\" 1>&2
Packit 8dc392
    exit 1
Packit 8dc392
  fi
Packit 8dc392
fi\
Packit 8dc392
"
Packit 8dc392
}
Packit 8dc392
# end: func_emit_wrapper_part2
Packit 8dc392
Packit 8dc392
Packit 8dc392
# func_emit_wrapper [arg=no]
Packit 8dc392
#
Packit 8dc392
# Emit a libtool wrapper script on stdout.
Packit 8dc392
# Don't directly open a file because we may want to
Packit 8dc392
# incorporate the script contents within a cygwin/mingw
Packit 8dc392
# wrapper executable.  Must ONLY be called from within
Packit 8dc392
# func_mode_link because it depends on a number of variables
Packit 8dc392
# set therein.
Packit 8dc392
#
Packit 8dc392
# ARG is the value that the WRAPPER_SCRIPT_BELONGS_IN_OBJDIR
Packit 8dc392
# variable will take.  If 'yes', then the emitted script
Packit 8dc392
# will assume that the directory in which it is stored is
Packit 8dc392
# the $objdir directory.  This is a cygwin/mingw-specific
Packit 8dc392
# behavior.
Packit 8dc392
func_emit_wrapper ()
Packit 8dc392
{
Packit 8dc392
	func_emit_wrapper_arg1=no
Packit 8dc392
	if test -n "$1" ; then
Packit 8dc392
	  func_emit_wrapper_arg1=$1
Packit 8dc392
	fi
Packit 8dc392
Packit 8dc392
	# split this up so that func_emit_cwrapperexe_src
Packit 8dc392
	# can call each part independently.
Packit 8dc392
	func_emit_wrapper_part1 "${func_emit_wrapper_arg1}"
Packit 8dc392
	func_emit_wrapper_part2 "${func_emit_wrapper_arg1}"
Packit 8dc392
}
Packit 8dc392
Packit 8dc392
Packit 8dc392
# func_to_host_path arg
Packit 8dc392
#
Packit 8dc392
# Convert paths to host format when used with build tools.
Packit 8dc392
# Intended for use with "native" mingw (where libtool itself
Packit 8dc392
# is running under the msys shell), or in the following cross-
Packit 8dc392
# build environments:
Packit 8dc392
#    $build          $host
Packit 8dc392
#    mingw (msys)    mingw  [e.g. native]
Packit 8dc392
#    cygwin          mingw
Packit 8dc392
#    *nix + wine     mingw
Packit 8dc392
# where wine is equipped with the `winepath' executable.
Packit 8dc392
# In the native mingw case, the (msys) shell automatically
Packit 8dc392
# converts paths for any non-msys applications it launches,
Packit 8dc392
# but that facility isn't available from inside the cwrapper.
Packit 8dc392
# Similar accommodations are necessary for $host mingw and
Packit 8dc392
# $build cygwin.  Calling this function does no harm for other
Packit 8dc392
# $host/$build combinations not listed above.
Packit 8dc392
#
Packit 8dc392
# ARG is the path (on $build) that should be converted to
Packit 8dc392
# the proper representation for $host. The result is stored
Packit 8dc392
# in $func_to_host_path_result.
Packit 8dc392
func_to_host_path ()
Packit 8dc392
{
Packit 8dc392
  func_to_host_path_result="$1"
Packit 8dc392
  if test -n "$1" ; then
Packit 8dc392
    case $host in
Packit 8dc392
      *mingw* )
Packit 8dc392
        lt_sed_naive_backslashify='s|\\\\*|\\|g;s|/|\\|g;s|\\|\\\\|g'
Packit 8dc392
        case $build in
Packit 8dc392
          *mingw* ) # actually, msys
Packit 8dc392
            # awkward: cmd appends spaces to result
Packit 8dc392
            lt_sed_strip_trailing_spaces="s/[ ]*\$//"
Packit 8dc392
            func_to_host_path_tmp1=`( cmd //c echo "$1" |\
Packit 8dc392
              $SED -e "$lt_sed_strip_trailing_spaces" ) 2>/dev/null || echo ""`
Packit 8dc392
            func_to_host_path_result=`echo "$func_to_host_path_tmp1" |\
Packit 8dc392
              $SED -e "$lt_sed_naive_backslashify"`
Packit 8dc392
            ;;
Packit 8dc392
          *cygwin* )
Packit 8dc392
            func_to_host_path_tmp1=`cygpath -w "$1"`
Packit 8dc392
            func_to_host_path_result=`echo "$func_to_host_path_tmp1" |\
Packit 8dc392
              $SED -e "$lt_sed_naive_backslashify"`
Packit 8dc392
            ;;
Packit 8dc392
          * )
Packit 8dc392
            # Unfortunately, winepath does not exit with a non-zero
Packit 8dc392
            # error code, so we are forced to check the contents of
Packit 8dc392
            # stdout. On the other hand, if the command is not
Packit 8dc392
            # found, the shell will set an exit code of 127 and print
Packit 8dc392
            # *an error message* to stdout. So we must check for both
Packit 8dc392
            # error code of zero AND non-empty stdout, which explains
Packit 8dc392
            # the odd construction:
Packit 8dc392
            func_to_host_path_tmp1=`winepath -w "$1" 2>/dev/null`
Packit 8dc392
            if test "$?" -eq 0 && test -n "${func_to_host_path_tmp1}"; then
Packit 8dc392
              func_to_host_path_result=`echo "$func_to_host_path_tmp1" |\
Packit 8dc392
                $SED -e "$lt_sed_naive_backslashify"`
Packit 8dc392
            else
Packit 8dc392
              # Allow warning below.
Packit 8dc392
              func_to_host_path_result=""
Packit 8dc392
            fi
Packit 8dc392
            ;;
Packit 8dc392
        esac
Packit 8dc392
        if test -z "$func_to_host_path_result" ; then
Packit 8dc392
          func_error "Could not determine host path corresponding to"
Packit 8dc392
          func_error "  '$1'"
Packit 8dc392
          func_error "Continuing, but uninstalled executables may not work."
Packit 8dc392
          # Fallback:
Packit 8dc392
          func_to_host_path_result="$1"
Packit 8dc392
        fi
Packit 8dc392
        ;;
Packit 8dc392
    esac
Packit 8dc392
  fi
Packit 8dc392
}
Packit 8dc392
# end: func_to_host_path
Packit 8dc392
Packit 8dc392
# func_to_host_pathlist arg
Packit 8dc392
#
Packit 8dc392
# Convert pathlists to host format when used with build tools.
Packit 8dc392
# See func_to_host_path(), above. This function supports the
Packit 8dc392
# following $build/$host combinations (but does no harm for
Packit 8dc392
# combinations not listed here):
Packit 8dc392
#    $build          $host
Packit 8dc392
#    mingw (msys)    mingw  [e.g. native]
Packit 8dc392
#    cygwin          mingw
Packit 8dc392
#    *nix + wine     mingw
Packit 8dc392
#
Packit 8dc392
# Path separators are also converted from $build format to
Packit 8dc392
# $host format. If ARG begins or ends with a path separator
Packit 8dc392
# character, it is preserved (but converted to $host format)
Packit 8dc392
# on output.
Packit 8dc392
#
Packit 8dc392
# ARG is a pathlist (on $build) that should be converted to
Packit 8dc392
# the proper representation on $host. The result is stored
Packit 8dc392
# in $func_to_host_pathlist_result.
Packit 8dc392
func_to_host_pathlist ()
Packit 8dc392
{
Packit 8dc392
  func_to_host_pathlist_result="$1"
Packit 8dc392
  if test -n "$1" ; then
Packit 8dc392
    case $host in
Packit 8dc392
      *mingw* )
Packit 8dc392
        lt_sed_naive_backslashify='s|\\\\*|\\|g;s|/|\\|g;s|\\|\\\\|g'
Packit 8dc392
        # Remove leading and trailing path separator characters from
Packit 8dc392
        # ARG. msys behavior is inconsistent here, cygpath turns them
Packit 8dc392
        # into '.;' and ';.', and winepath ignores them completely.
Packit 8dc392
        func_to_host_pathlist_tmp2="$1"
Packit 8dc392
        # Once set for this call, this variable should not be
Packit 8dc392
        # reassigned. It is used in tha fallback case.
Packit 8dc392
        func_to_host_pathlist_tmp1=`echo "$func_to_host_pathlist_tmp2" |\
Packit 8dc392
          $SED -e 's|^:*||' -e 's|:*$||'`
Packit 8dc392
        case $build in
Packit 8dc392
          *mingw* ) # Actually, msys.
Packit 8dc392
            # Awkward: cmd appends spaces to result.
Packit 8dc392
            lt_sed_strip_trailing_spaces="s/[ ]*\$//"
Packit 8dc392
            func_to_host_pathlist_tmp2=`( cmd //c echo "$func_to_host_pathlist_tmp1" |\
Packit 8dc392
              $SED -e "$lt_sed_strip_trailing_spaces" ) 2>/dev/null || echo ""`
Packit 8dc392
            func_to_host_pathlist_result=`echo "$func_to_host_pathlist_tmp2" |\
Packit 8dc392
              $SED -e "$lt_sed_naive_backslashify"`
Packit 8dc392
            ;;
Packit 8dc392
          *cygwin* )
Packit 8dc392
            func_to_host_pathlist_tmp2=`cygpath -w -p "$func_to_host_pathlist_tmp1"`
Packit 8dc392
            func_to_host_pathlist_result=`echo "$func_to_host_pathlist_tmp2" |\
Packit 8dc392
              $SED -e "$lt_sed_naive_backslashify"`
Packit 8dc392
            ;;
Packit 8dc392
          * )
Packit 8dc392
            # unfortunately, winepath doesn't convert pathlists
Packit 8dc392
            func_to_host_pathlist_result=""
Packit 8dc392
            func_to_host_pathlist_oldIFS=$IFS
Packit 8dc392
            IFS=:
Packit 8dc392
            for func_to_host_pathlist_f in $func_to_host_pathlist_tmp1 ; do
Packit 8dc392
              IFS=$func_to_host_pathlist_oldIFS
Packit 8dc392
              if test -n "$func_to_host_pathlist_f" ; then
Packit 8dc392
                func_to_host_path "$func_to_host_pathlist_f"
Packit 8dc392
                if test -n "$func_to_host_path_result" ; then
Packit 8dc392
                  if test -z "$func_to_host_pathlist_result" ; then
Packit 8dc392
                    func_to_host_pathlist_result="$func_to_host_path_result"
Packit 8dc392
                  else
Packit 8dc392
                    func_to_host_pathlist_result="$func_to_host_pathlist_result;$func_to_host_path_result"
Packit 8dc392
                  fi
Packit 8dc392
                fi
Packit 8dc392
              fi
Packit 8dc392
              IFS=:
Packit 8dc392
            done
Packit 8dc392
            IFS=$func_to_host_pathlist_oldIFS
Packit 8dc392
            ;;
Packit 8dc392
        esac
Packit 8dc392
        if test -z "$func_to_host_pathlist_result" ; then
Packit 8dc392
          func_error "Could not determine the host path(s) corresponding to"
Packit 8dc392
          func_error "  '$1'"
Packit 8dc392
          func_error "Continuing, but uninstalled executables may not work."
Packit 8dc392
          # Fallback. This may break if $1 contains DOS-style drive
Packit 8dc392
          # specifications. The fix is not to complicate the expression
Packit 8dc392
          # below, but for the user to provide a working wine installation
Packit 8dc392
          # with winepath so that path translation in the cross-to-mingw
Packit 8dc392
          # case works properly.
Packit 8dc392
          lt_replace_pathsep_nix_to_dos="s|:|;|g"
Packit 8dc392
          func_to_host_pathlist_result=`echo "$func_to_host_pathlist_tmp1" |\
Packit 8dc392
            $SED -e "$lt_replace_pathsep_nix_to_dos"`
Packit 8dc392
        fi
Packit 8dc392
        # Now, add the leading and trailing path separators back
Packit 8dc392
        case "$1" in
Packit 8dc392
          :* ) func_to_host_pathlist_result=";$func_to_host_pathlist_result"
Packit 8dc392
            ;;
Packit 8dc392
        esac
Packit 8dc392
        case "$1" in
Packit 8dc392
          *: ) func_to_host_pathlist_result="$func_to_host_pathlist_result;"
Packit 8dc392
            ;;
Packit 8dc392
        esac
Packit 8dc392
        ;;
Packit 8dc392
    esac
Packit 8dc392
  fi
Packit 8dc392
}
Packit 8dc392
# end: func_to_host_pathlist
Packit 8dc392
Packit 8dc392
# func_emit_cwrapperexe_src
Packit 8dc392
# emit the source code for a wrapper executable on stdout
Packit 8dc392
# Must ONLY be called from within func_mode_link because
Packit 8dc392
# it depends on a number of variable set therein.
Packit 8dc392
func_emit_cwrapperexe_src ()
Packit 8dc392
{
Packit 8dc392
	cat <
Packit 8dc392
Packit 8dc392
/* $cwrappersource - temporary wrapper executable for $objdir/$outputname
Packit 8dc392
   Generated by $PROGRAM (GNU $PACKAGE$TIMESTAMP) $VERSION
Packit 8dc392
Packit 8dc392
   The $output program cannot be directly executed until all the libtool
Packit 8dc392
   libraries that it depends on are installed.
Packit 8dc392
Packit 8dc392
   This wrapper executable should never be moved out of the build directory.
Packit 8dc392
   If it is, it will not operate correctly.
Packit 8dc392
Packit 8dc392
   Currently, it simply execs the wrapper *script* "$SHELL $output",
Packit 8dc392
   but could eventually absorb all of the scripts functionality and
Packit 8dc392
   exec $objdir/$outputname directly.
Packit 8dc392
*/
Packit 8dc392
EOF
Packit 8dc392
	    cat <<"EOF"
Packit 8dc392
#include <stdio.h>
Packit 8dc392
#include <stdlib.h>
Packit 8dc392
#ifdef _MSC_VER
Packit 8dc392
# include <direct.h>
Packit 8dc392
# include <process.h>
Packit 8dc392
# include <io.h>
Packit 8dc392
# define setmode _setmode
Packit 8dc392
#else
Packit 8dc392
# include <unistd.h>
Packit 8dc392
# include <stdint.h>
Packit 8dc392
# ifdef __CYGWIN__
Packit 8dc392
#  include <io.h>
Packit 8dc392
#  define HAVE_SETENV
Packit 8dc392
#  ifdef __STRICT_ANSI__
Packit 8dc392
char *realpath (const char *, char *);
Packit 8dc392
int putenv (char *);
Packit 8dc392
int setenv (const char *, const char *, int);
Packit 8dc392
#  endif
Packit 8dc392
# endif
Packit 8dc392
#endif
Packit 8dc392
#include <malloc.h>
Packit 8dc392
#include <stdarg.h>
Packit 8dc392
#include <assert.h>
Packit 8dc392
#include <string.h>
Packit 8dc392
#include <ctype.h>
Packit 8dc392
#include <errno.h>
Packit 8dc392
#include <fcntl.h>
Packit 8dc392
#include <sys/stat.h>
Packit 8dc392
Packit 8dc392
#if defined(PATH_MAX)
Packit 8dc392
# define LT_PATHMAX PATH_MAX
Packit 8dc392
#elif defined(MAXPATHLEN)
Packit 8dc392
# define LT_PATHMAX MAXPATHLEN
Packit 8dc392
#else
Packit 8dc392
# define LT_PATHMAX 1024
Packit 8dc392
#endif
Packit 8dc392
Packit 8dc392
#ifndef S_IXOTH
Packit 8dc392
# define S_IXOTH 0
Packit 8dc392
#endif
Packit 8dc392
#ifndef S_IXGRP
Packit 8dc392
# define S_IXGRP 0
Packit 8dc392
#endif
Packit 8dc392
Packit 8dc392
#ifdef _MSC_VER
Packit 8dc392
# define S_IXUSR _S_IEXEC
Packit 8dc392
# define stat _stat
Packit 8dc392
# ifndef _INTPTR_T_DEFINED
Packit 8dc392
#  define intptr_t int
Packit 8dc392
# endif
Packit 8dc392
#endif
Packit 8dc392
Packit 8dc392
#ifndef DIR_SEPARATOR
Packit 8dc392
# define DIR_SEPARATOR '/'
Packit 8dc392
# define PATH_SEPARATOR ':'
Packit 8dc392
#endif
Packit 8dc392
Packit 8dc392
#if defined (_WIN32) || defined (__MSDOS__) || defined (__DJGPP__) || \
Packit 8dc392
  defined (__OS2__)
Packit 8dc392
# define HAVE_DOS_BASED_FILE_SYSTEM
Packit 8dc392
# define FOPEN_WB "wb"
Packit 8dc392
# ifndef DIR_SEPARATOR_2
Packit 8dc392
#  define DIR_SEPARATOR_2 '\\'
Packit 8dc392
# endif
Packit 8dc392
# ifndef PATH_SEPARATOR_2
Packit 8dc392
#  define PATH_SEPARATOR_2 ';'
Packit 8dc392
# endif
Packit 8dc392
#endif
Packit 8dc392
Packit 8dc392
#ifndef DIR_SEPARATOR_2
Packit 8dc392
# define IS_DIR_SEPARATOR(ch) ((ch) == DIR_SEPARATOR)
Packit 8dc392
#else /* DIR_SEPARATOR_2 */
Packit 8dc392
# define IS_DIR_SEPARATOR(ch) \
Packit 8dc392
	(((ch) == DIR_SEPARATOR) || ((ch) == DIR_SEPARATOR_2))
Packit 8dc392
#endif /* DIR_SEPARATOR_2 */
Packit 8dc392
Packit 8dc392
#ifndef PATH_SEPARATOR_2
Packit 8dc392
# define IS_PATH_SEPARATOR(ch) ((ch) == PATH_SEPARATOR)
Packit 8dc392
#else /* PATH_SEPARATOR_2 */
Packit 8dc392
# define IS_PATH_SEPARATOR(ch) ((ch) == PATH_SEPARATOR_2)
Packit 8dc392
#endif /* PATH_SEPARATOR_2 */
Packit 8dc392
Packit 8dc392
#ifdef __CYGWIN__
Packit 8dc392
# define FOPEN_WB "wb"
Packit 8dc392
#endif
Packit 8dc392
Packit 8dc392
#ifndef FOPEN_WB
Packit 8dc392
# define FOPEN_WB "w"
Packit 8dc392
#endif
Packit 8dc392
#ifndef _O_BINARY
Packit 8dc392
# define _O_BINARY 0
Packit 8dc392
#endif
Packit 8dc392
Packit 8dc392
#define XMALLOC(type, num)      ((type *) xmalloc ((num) * sizeof(type)))
Packit 8dc392
#define XFREE(stale) do { \
Packit 8dc392
  if (stale) { free ((void *) stale); stale = 0; } \
Packit 8dc392
} while (0)
Packit 8dc392
Packit 8dc392
#undef LTWRAPPER_DEBUGPRINTF
Packit 8dc392
#if defined DEBUGWRAPPER
Packit 8dc392
# define LTWRAPPER_DEBUGPRINTF(args) ltwrapper_debugprintf args
Packit 8dc392
static void
Packit 8dc392
ltwrapper_debugprintf (const char *fmt, ...)
Packit 8dc392
{
Packit 8dc392
    va_list args;
Packit 8dc392
    va_start (args, fmt);
Packit 8dc392
    (void) vfprintf (stderr, fmt, args);
Packit 8dc392
    va_end (args);
Packit 8dc392
}
Packit 8dc392
#else
Packit 8dc392
# define LTWRAPPER_DEBUGPRINTF(args)
Packit 8dc392
#endif
Packit 8dc392
Packit 8dc392
const char *program_name = NULL;
Packit 8dc392
Packit 8dc392
void *xmalloc (size_t num);
Packit 8dc392
char *xstrdup (const char *string);
Packit 8dc392
const char *base_name (const char *name);
Packit 8dc392
char *find_executable (const char *wrapper);
Packit 8dc392
char *chase_symlinks (const char *pathspec);
Packit 8dc392
int make_executable (const char *path);
Packit 8dc392
int check_executable (const char *path);
Packit 8dc392
char *strendzap (char *str, const char *pat);
Packit 8dc392
void lt_fatal (const char *message, ...);
Packit 8dc392
void lt_setenv (const char *name, const char *value);
Packit 8dc392
char *lt_extend_str (const char *orig_value, const char *add, int to_end);
Packit 8dc392
void lt_opt_process_env_set (const char *arg);
Packit 8dc392
void lt_opt_process_env_prepend (const char *arg);
Packit 8dc392
void lt_opt_process_env_append (const char *arg);
Packit 8dc392
int lt_split_name_value (const char *arg, char** name, char** value);
Packit 8dc392
void lt_update_exe_path (const char *name, const char *value);
Packit 8dc392
void lt_update_lib_path (const char *name, const char *value);
Packit 8dc392
Packit 8dc392
static const char *script_text_part1 =
Packit 8dc392
EOF
Packit 8dc392
Packit 8dc392
	    func_emit_wrapper_part1 yes |
Packit 8dc392
	        $SED -e 's/\([\\"]\)/\\\1/g' \
Packit 8dc392
	             -e 's/^/  "/' -e 's/$/\\n"/'
Packit 8dc392
	    echo ";"
Packit 8dc392
	    cat <
Packit 8dc392
Packit