/recipes/binutils/binutils-2.20.1/libtool-2.4-update.patch
Patch | 1571 lines | 1502 code | 69 blank | 0 comment | 0 complexity | 0a9753e47834d64dd31b70452911c1a5 MD5 | raw file
Possible License(s): BSD-3-Clause, GPL-2.0, GPL-3.0, LGPL-2.0, LGPL-2.1, LGPL-3.0
- Index: binutils-2.20.1/ltmain.sh
- ===================================================================
- --- binutils-2.20.1.orig/ltmain.sh
- +++ binutils-2.20.1/ltmain.sh
- @@ -1,9 +1,9 @@
- -# Generated from ltmain.m4sh.
-
- -# ltmain.sh (GNU libtool) 2.2.6
- +# libtool (GNU libtool) 2.4
- # Written by Gordon Matzigkeit <gord@gnu.ai.mit.edu>, 1996
-
- -# Copyright (C) 1996, 1997, 1998, 1999, 2000, 2001, 2003, 2004, 2005, 2006, 2007 2008 Free Software Foundation, Inc.
- +# Copyright (C) 1996, 1997, 1998, 1999, 2000, 2001, 2003, 2004, 2005, 2006,
- +# 2007, 2008, 2009, 2010 Free Software Foundation, Inc.
- # This is free software; see the source for copying conditions. There is NO
- # warranty; not even for MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
-
- @@ -32,50 +32,56 @@
- #
- # Provide generalized library-building support services.
- #
- -# --config show all configuration variables
- -# --debug enable verbose shell tracing
- -# -n, --dry-run display commands without modifying any files
- -# --features display basic configuration information and exit
- -# --mode=MODE use operation mode MODE
- -# --preserve-dup-deps don't remove duplicate dependency libraries
- -# --quiet, --silent don't print informational messages
- -# --tag=TAG use configuration variables from tag TAG
- -# -v, --verbose print informational messages (default)
- -# --version print version information
- -# -h, --help print short or long help message
- +# --config show all configuration variables
- +# --debug enable verbose shell tracing
- +# -n, --dry-run display commands without modifying any files
- +# --features display basic configuration information and exit
- +# --mode=MODE use operation mode MODE
- +# --preserve-dup-deps don't remove duplicate dependency libraries
- +# --quiet, --silent don't print informational messages
- +# --no-quiet, --no-silent
- +# print informational messages (default)
- +# --tag=TAG use configuration variables from tag TAG
- +# -v, --verbose print more informational messages than default
- +# --no-verbose don't print the extra informational messages
- +# --version print version information
- +# -h, --help, --help-all print short, long, or detailed help message
- #
- # MODE must be one of the following:
- #
- -# clean remove files from the build directory
- -# compile compile a source file into a libtool object
- -# execute automatically set library path, then run a program
- -# finish complete the installation of libtool libraries
- -# install install libraries or executables
- -# link create a library or an executable
- -# uninstall remove libraries from an installed directory
- +# clean remove files from the build directory
- +# compile compile a source file into a libtool object
- +# execute automatically set library path, then run a program
- +# finish complete the installation of libtool libraries
- +# install install libraries or executables
- +# link create a library or an executable
- +# uninstall remove libraries from an installed directory
- #
- -# MODE-ARGS vary depending on the MODE.
- +# MODE-ARGS vary depending on the MODE. When passed as first option,
- +# `--mode=MODE' may be abbreviated as `MODE' or a unique abbreviation of that.
- # Try `$progname --help --mode=MODE' for a more detailed description of MODE.
- #
- # When reporting a bug, please describe a test case to reproduce it and
- # include the following information:
- #
- -# host-triplet: $host
- -# shell: $SHELL
- -# compiler: $LTCC
- -# compiler flags: $LTCFLAGS
- -# linker: $LD (gnu? $with_gnu_ld)
- -# $progname: (GNU libtool) 2.2.6
- -# automake: $automake_version
- -# autoconf: $autoconf_version
- +# host-triplet: $host
- +# shell: $SHELL
- +# compiler: $LTCC
- +# compiler flags: $LTCFLAGS
- +# linker: $LD (gnu? $with_gnu_ld)
- +# $progname: (GNU libtool) 2.4
- +# automake: $automake_version
- +# autoconf: $autoconf_version
- #
- # Report bugs to <bug-libtool@gnu.org>.
- +# GNU libtool home page: <http://www.gnu.org/software/libtool/>.
- +# General help using GNU software: <http://www.gnu.org/gethelp/>.
-
- -PROGRAM=ltmain.sh
- +PROGRAM=libtool
- PACKAGE=libtool
- -VERSION=2.2.6
- +VERSION=2.4
- TIMESTAMP=""
- -package_revision=1.3012
- +package_revision=1.3293
-
- # Be Bourne compatible
- if test -n "${ZSH_VERSION+set}" && (emulate sh) >/dev/null 2>&1; then
- @@ -91,10 +97,15 @@ fi
- BIN_SH=xpg4; export BIN_SH # for Tru64
- DUALCASE=1; export DUALCASE # for MKS sh
-
- +# A function that is used when there is no print builtin or printf.
- +func_fallback_echo ()
- +{
- + eval 'cat <<_LTECHO_EOF
- +$1
- +_LTECHO_EOF'
- +}
- +
- # NLS nuisances: We save the old values to restore during execute mode.
- -# Only set LANG and LC_ALL to C if already set.
- -# These must not be set unconditionally because not all systems understand
- -# e.g. LANG=C (notably SCO).
- lt_user_locale=
- lt_safe_locale=
- for lt_var in LANG LANGUAGE LC_ALL LC_CTYPE LC_COLLATE LC_MESSAGES
- @@ -107,24 +118,33 @@ do
- lt_safe_locale=\"$lt_var=C; \$lt_safe_locale\"
- fi"
- done
- +LC_ALL=C
- +LANGUAGE=C
- +export LANGUAGE LC_ALL
-
- $lt_unset CDPATH
-
-
- +# Work around backward compatibility issue on IRIX 6.5. On IRIX 6.4+, sh
- +# is ksh but when the shell is invoked as "sh" and the current value of
- +# the _XPG environment variable is not equal to 1 (one), the special
- +# positional parameter $0, within a function call, is the name of the
- +# function.
- +progpath="$0"
-
-
-
- : ${CP="cp -f"}
- -: ${ECHO="echo"}
- -: ${EGREP="/usr/bin/grep -E"}
- -: ${FGREP="/usr/bin/grep -F"}
- -: ${GREP="/usr/bin/grep"}
- +test "${ECHO+set}" = set || ECHO=${as_echo-'printf %s\n'}
- +: ${EGREP="/bin/grep -E"}
- +: ${FGREP="/bin/grep -F"}
- +: ${GREP="/bin/grep"}
- : ${LN_S="ln -s"}
- : ${MAKE="make"}
- : ${MKDIR="mkdir"}
- : ${MV="mv -f"}
- : ${RM="rm -f"}
- -: ${SED="/opt/local/bin/gsed"}
- +: ${SED="/bin/sed"}
- : ${SHELL="${CONFIG_SHELL-/bin/sh}"}
- : ${Xsed="$SED -e 1s/^X//"}
-
- @@ -144,6 +164,27 @@ IFS=" $lt_nl"
- dirname="s,/[^/]*$,,"
- basename="s,^.*/,,"
-
- +# func_dirname file append nondir_replacement
- +# Compute the dirname of FILE. If nonempty, add APPEND to the result,
- +# otherwise set result to NONDIR_REPLACEMENT.
- +func_dirname ()
- +{
- + func_dirname_result=`$ECHO "${1}" | $SED "$dirname"`
- + if test "X$func_dirname_result" = "X${1}"; then
- + func_dirname_result="${3}"
- + else
- + func_dirname_result="$func_dirname_result${2}"
- + fi
- +} # func_dirname may be replaced by extended shell implementation
- +
- +
- +# func_basename file
- +func_basename ()
- +{
- + func_basename_result=`$ECHO "${1}" | $SED "$basename"`
- +} # func_basename may be replaced by extended shell implementation
- +
- +
- # func_dirname_and_basename file append nondir_replacement
- # perform func_basename and func_dirname in a single function
- # call:
- @@ -158,24 +199,41 @@ basename="s,^.*/,,"
- # those functions but instead duplicate the functionality here.
- func_dirname_and_basename ()
- {
- - # Extract subdirectory from the argument.
- - func_dirname_result=`$ECHO "X${1}" | $Xsed -e "$dirname"`
- - if test "X$func_dirname_result" = "X${1}"; then
- - func_dirname_result="${3}"
- - else
- - func_dirname_result="$func_dirname_result${2}"
- - fi
- - func_basename_result=`$ECHO "X${1}" | $Xsed -e "$basename"`
- -}
- + # Extract subdirectory from the argument.
- + func_dirname_result=`$ECHO "${1}" | $SED -e "$dirname"`
- + if test "X$func_dirname_result" = "X${1}"; then
- + func_dirname_result="${3}"
- + else
- + func_dirname_result="$func_dirname_result${2}"
- + fi
- + func_basename_result=`$ECHO "${1}" | $SED -e "$basename"`
- +} # func_dirname_and_basename may be replaced by extended shell implementation
- +
- +
- +# func_stripname prefix suffix name
- +# strip PREFIX and SUFFIX off of NAME.
- +# PREFIX and SUFFIX must not contain globbing or regex special
- +# characters, hashes, percent signs, but SUFFIX may contain a leading
- +# dot (in which case that matches only a dot).
- +# func_strip_suffix prefix name
- +func_stripname ()
- +{
- + case ${2} in
- + .*) func_stripname_result=`$ECHO "${3}" | $SED "s%^${1}%%; s%\\\\${2}\$%%"`;;
- + *) func_stripname_result=`$ECHO "${3}" | $SED "s%^${1}%%; s%${2}\$%%"`;;
- + esac
- +} # func_stripname may be replaced by extended shell implementation
-
- -# Generated shell functions inserted here.
-
- # These SED scripts presuppose an absolute path with a trailing slash.
- -pathcar="s,^/\([^/]*\).*$,\1,"
- -pathcdr="s,^/[^/]*,,"
- -removedotparts="s@/\(\./\)\{1,\}@/@g;s,/\.$,/,"
- -collapseslashes="s@/\{1,\}@/@g"
- -finalslash="s,/*$,/,"
- +pathcar='s,^/\([^/]*\).*$,\1,'
- +pathcdr='s,^/[^/]*,,'
- +removedotparts=':dotsl
- + s@/\./@/@g
- + t dotsl
- + s,/\.$,/,'
- +collapseslashes='s@/\{1,\}@/@g'
- +finalslash='s,/*$,/,'
-
- # func_normal_abspath PATH
- # Remove doubled-up and trailing slashes, "." path components,
- @@ -315,21 +373,9 @@ func_relative_path ()
- fi
- }
-
- -# Work around backward compatibility issue on IRIX 6.5. On IRIX 6.4+, sh
- -# is ksh but when the shell is invoked as "sh" and the current value of
- -# the _XPG environment variable is not equal to 1 (one), the special
- -# positional parameter $0, within a function call, is the name of the
- -# function.
- -progpath="$0"
- -
- # The name of this program:
- -# In the unlikely event $progname began with a '-', it would play havoc with
- -# func_echo (imagine progname=-n), so we prepend ./ in that case:
- func_dirname_and_basename "$progpath"
- progname=$func_basename_result
- -case $progname in
- - -*) progname=./$progname ;;
- -esac
-
- # Make sure we have an absolute path for reexecution:
- case $progpath in
- @@ -360,6 +406,15 @@ sed_quote_subst='s/\([`"$\\]\)/\\\1/g'
- # Same as above, but do not quote variable references.
- double_quote_subst='s/\(["`\\]\)/\\\1/g'
-
- +# Sed substitution that turns a string into a regex matching for the
- +# string literally.
- +sed_make_literal_regex='s,[].[^$\\*\/],\\&,g'
- +
- +# Sed substitution that converts a w32 file name or path
- +# which contains forward slashes, into one that contains
- +# (escaped) backslashes. A very naive implementation.
- +lt_sed_naive_backslashify='s|\\\\*|\\|g;s|/|\\|g;s|\\|\\\\|g'
- +
- # Re-`\' parameter expansions in output of double_quote_subst that were
- # `\'-ed in input to the same. If an odd number of `\' preceded a '$'
- # in input to double_quote_subst, that '$' was protected from expansion.
- @@ -388,7 +443,7 @@ opt_warning=:
- # name if it has been set yet.
- func_echo ()
- {
- - $ECHO "$progname${mode+: }$mode: $*"
- + $ECHO "$progname: ${opt_mode+$opt_mode: }$*"
- }
-
- # func_verbose arg...
- @@ -403,18 +458,25 @@ func_verbose ()
- :
- }
-
- +# func_echo_all arg...
- +# Invoke $ECHO with all args, space-separated.
- +func_echo_all ()
- +{
- + $ECHO "$*"
- +}
- +
- # func_error arg...
- # Echo program name prefixed message to standard error.
- func_error ()
- {
- - $ECHO "$progname${mode+: }$mode: "${1+"$@"} 1>&2
- + $ECHO "$progname: ${opt_mode+$opt_mode: }"${1+"$@"} 1>&2
- }
-
- # func_warning arg...
- # Echo program name prefixed warning message to standard error.
- func_warning ()
- {
- - $opt_warning && $ECHO "$progname${mode+: }$mode: warning: "${1+"$@"} 1>&2
- + $opt_warning && $ECHO "$progname: ${opt_mode+$opt_mode: }warning: "${1+"$@"} 1>&2
-
- # bash bug again:
- :
- @@ -471,9 +533,9 @@ func_mkdir_p ()
- case $my_directory_path in */*) ;; *) break ;; esac
-
- # ...otherwise throw away the child directory and loop
- - my_directory_path=`$ECHO "X$my_directory_path" | $Xsed -e "$dirname"`
- + my_directory_path=`$ECHO "$my_directory_path" | $SED -e "$dirname"`
- done
- - my_dir_list=`$ECHO "X$my_dir_list" | $Xsed -e 's,:*$,,'`
- + my_dir_list=`$ECHO "$my_dir_list" | $SED 's,:*$,,'`
-
- save_mkdir_p_IFS="$IFS"; IFS=':'
- for my_dir in $my_dir_list; do
- @@ -523,7 +585,7 @@ func_mktempdir ()
- func_fatal_error "cannot create temporary directory \`$my_tmpdir'"
- fi
-
- - $ECHO "X$my_tmpdir" | $Xsed
- + $ECHO "$my_tmpdir"
- }
-
-
- @@ -537,7 +599,7 @@ func_quote_for_eval ()
- {
- case $1 in
- *[\\\`\"\$]*)
- - func_quote_for_eval_unquoted_result=`$ECHO "X$1" | $Xsed -e "$sed_quote_subst"` ;;
- + func_quote_for_eval_unquoted_result=`$ECHO "$1" | $SED "$sed_quote_subst"` ;;
- *)
- func_quote_for_eval_unquoted_result="$1" ;;
- esac
- @@ -564,7 +626,7 @@ func_quote_for_expand ()
- {
- case $1 in
- *[\\\`\"]*)
- - my_arg=`$ECHO "X$1" | $Xsed \
- + my_arg=`$ECHO "$1" | $SED \
- -e "$double_quote_subst" -e "$sed_double_backslash"` ;;
- *)
- my_arg="$1" ;;
- @@ -633,15 +695,39 @@ func_show_eval_locale ()
- fi
- }
-
- -
- -
- +# func_tr_sh
- +# Turn $1 into a string suitable for a shell variable name.
- +# Result is stored in $func_tr_sh_result. All characters
- +# not in the set a-zA-Z0-9_ are replaced with '_'. Further,
- +# if $1 begins with a digit, a '_' is prepended as well.
- +func_tr_sh ()
- +{
- + case $1 in
- + [0-9]* | *[!a-zA-Z0-9_]*)
- + func_tr_sh_result=`$ECHO "$1" | $SED 's/^\([0-9]\)/_\1/; s/[^a-zA-Z0-9_]/_/g'`
- + ;;
- + * )
- + func_tr_sh_result=$1
- + ;;
- + esac
- +}
-
-
- # func_version
- # Echo version message to standard output and exit.
- func_version ()
- {
- - $SED -n '/^# '$PROGRAM' (GNU /,/# warranty; / {
- + $opt_debug
- +
- + $SED -n '/(C)/!b go
- + :more
- + /\./!{
- + N
- + s/\n# / /
- + b more
- + }
- + :go
- + /^# '$PROGRAM' (GNU /,/# warranty; / {
- s/^# //
- s/^# *$//
- s/\((C)\)[ 0-9,-]*\( [1-9][0-9]*\)/\1\2/
- @@ -654,22 +740,28 @@ func_version ()
- # Echo short help message to standard output and exit.
- func_usage ()
- {
- - $SED -n '/^# Usage:/,/# -h/ {
- + $opt_debug
- +
- + $SED -n '/^# Usage:/,/^# *.*--help/ {
- s/^# //
- s/^# *$//
- s/\$progname/'$progname'/
- p
- }' < "$progpath"
- - $ECHO
- + echo
- $ECHO "run \`$progname --help | more' for full usage"
- exit $?
- }
-
- -# func_help
- -# Echo long help message to standard output and exit.
- +# func_help [NOEXIT]
- +# Echo long help message to standard output and exit,
- +# unless 'noexit' is passed as argument.
- func_help ()
- {
- + $opt_debug
- +
- $SED -n '/^# Usage:/,/# Report bugs to/ {
- + :print
- s/^# //
- s/^# *$//
- s*\$progname*'$progname'*
- @@ -682,8 +774,15 @@ func_help ()
- s/\$automake_version/'"`(automake --version) 2>/dev/null |$SED 1q`"'/
- s/\$autoconf_version/'"`(autoconf --version) 2>/dev/null |$SED 1q`"'/
- p
- - }' < "$progpath"
- - exit $?
- + d
- + }
- + /^# .* home page:/b print
- + /^# General help using/b print
- + ' < "$progpath"
- + ret=$?
- + if test -z "$1"; then
- + exit $ret
- + fi
- }
-
- # func_missing_arg argname
- @@ -691,63 +790,106 @@ func_help ()
- # exit_cmd.
- func_missing_arg ()
- {
- - func_error "missing argument for $1"
- + $opt_debug
- +
- + func_error "missing argument for $1."
- exit_cmd=exit
- }
-
- -exit_cmd=:
-
- +# func_split_short_opt shortopt
- +# Set func_split_short_opt_name and func_split_short_opt_arg shell
- +# variables after splitting SHORTOPT after the 2nd character.
- +func_split_short_opt ()
- +{
- + my_sed_short_opt='1s/^\(..\).*$/\1/;q'
- + my_sed_short_rest='1s/^..\(.*\)$/\1/;q'
- +
- + func_split_short_opt_name=`$ECHO "$1" | $SED "$my_sed_short_opt"`
- + func_split_short_opt_arg=`$ECHO "$1" | $SED "$my_sed_short_rest"`
- +} # func_split_short_opt may be replaced by extended shell implementation
- +
- +
- +# func_split_long_opt longopt
- +# Set func_split_long_opt_name and func_split_long_opt_arg shell
- +# variables after splitting LONGOPT at the `=' sign.
- +func_split_long_opt ()
- +{
- + my_sed_long_opt='1s/^\(--[^=]*\)=.*/\1/;q'
- + my_sed_long_arg='1s/^--[^=]*=//'
- +
- + func_split_long_opt_name=`$ECHO "$1" | $SED "$my_sed_long_opt"`
- + func_split_long_opt_arg=`$ECHO "$1" | $SED "$my_sed_long_arg"`
- +} # func_split_long_opt may be replaced by extended shell implementation
-
- +exit_cmd=:
-
-
-
- -# Check that we have a working $ECHO.
- -if test "X$1" = X--no-reexec; then
- - # Discard the --no-reexec flag, and continue.
- - shift
- -elif test "X$1" = X--fallback-echo; then
- - # Avoid inline document here, it may be left over
- - :
- -elif test "X`{ $ECHO '\t'; } 2>/dev/null`" = 'X\t'; then
- - # Yippee, $ECHO works!
- - :
- -else
- - # Restart under the correct shell, and then maybe $ECHO will work.
- - exec $SHELL "$progpath" --no-reexec ${1+"$@"}
- -fi
-
- -if test "X$1" = X--fallback-echo; then
- - # used as fallback echo
- - shift
- - cat <<EOF
- -$*
- -EOF
- - exit $EXIT_SUCCESS
- -fi
-
- magic="%%%MAGIC variable%%%"
- magic_exe="%%%MAGIC EXE variable%%%"
-
- # Global variables.
- -# $mode is unset
- nonopt=
- -execute_dlfiles=
- preserve_args=
- lo2o="s/\\.lo\$/.${objext}/"
- o2lo="s/\\.${objext}\$/.lo/"
- extracted_archives=
- extracted_serial=0
-
- -opt_dry_run=false
- -opt_duplicate_deps=false
- -opt_silent=false
- -opt_debug=:
- -
- # If this variable is set in any of the actions, the command in it
- # will be execed at the end. This prevents here-documents from being
- # left over by shells.
- exec_cmd=
-
- +# func_append var value
- +# Append VALUE to the end of shell variable VAR.
- +func_append ()
- +{
- + eval "${1}=\$${1}\${2}"
- +} # func_append may be replaced by extended shell implementation
- +
- +# func_append_quoted var value
- +# Quote VALUE and append to the end of shell variable VAR, separated
- +# by a space.
- +func_append_quoted ()
- +{
- + func_quote_for_eval "${2}"
- + eval "${1}=\$${1}\\ \$func_quote_for_eval_result"
- +} # func_append_quoted may be replaced by extended shell implementation
- +
- +
- +# func_arith arithmetic-term...
- +func_arith ()
- +{
- + func_arith_result=`expr "${@}"`
- +} # func_arith may be replaced by extended shell implementation
- +
- +
- +# func_len string
- +# STRING may not start with a hyphen.
- +func_len ()
- +{
- + func_len_result=`expr "${1}" : ".*" 2>/dev/null || echo $max_cmd_len`
- +} # func_len may be replaced by extended shell implementation
- +
- +
- +# func_lo2o object
- +func_lo2o ()
- +{
- + func_lo2o_result=`$ECHO "${1}" | $SED "$lo2o"`
- +} # func_lo2o may be replaced by extended shell implementation
- +
- +
- +# func_xform libobj-or-source
- +func_xform ()
- +{
- + func_xform_result=`$ECHO "${1}" | $SED 's/\.[^.]*$/.lo/'`
- +} # func_xform may be replaced by extended shell implementation
- +
- +
- # func_fatal_configuration arg...
- # Echo program name prefixed message to standard error, followed by
- # a configuration failure hint, and exit.
- @@ -781,16 +923,16 @@ func_config ()
- # Display the features supported by this script.
- func_features ()
- {
- - $ECHO "host: $host"
- + echo "host: $host"
- if test "$build_libtool_libs" = yes; then
- - $ECHO "enable shared libraries"
- + echo "enable shared libraries"
- else
- - $ECHO "disable shared libraries"
- + echo "disable shared libraries"
- fi
- if test "$build_old_libs" = yes; then
- - $ECHO "enable static libraries"
- + echo "enable static libraries"
- else
- - $ECHO "disable static libraries"
- + echo "disable static libraries"
- fi
-
- exit $?
- @@ -837,117 +979,204 @@ func_enable_tag ()
- esac
- }
-
- -# Parse options once, thoroughly. This comes as soon as possible in
- -# the script to make things like `libtool --version' happen quickly.
- +# func_check_version_match
- +# Ensure that we are using m4 macros, and libtool script from the same
- +# release of libtool.
- +func_check_version_match ()
- {
- + if test "$package_revision" != "$macro_revision"; then
- + if test "$VERSION" != "$macro_version"; then
- + if test -z "$macro_version"; then
- + cat >&2 <<_LT_EOF
- +$progname: Version mismatch error. This is $PACKAGE $VERSION, but the
- +$progname: definition of this LT_INIT comes from an older release.
- +$progname: You should recreate aclocal.m4 with macros from $PACKAGE $VERSION
- +$progname: and run autoconf again.
- +_LT_EOF
- + else
- + cat >&2 <<_LT_EOF
- +$progname: Version mismatch error. This is $PACKAGE $VERSION, but the
- +$progname: definition of this LT_INIT comes from $PACKAGE $macro_version.
- +$progname: You should recreate aclocal.m4 with macros from $PACKAGE $VERSION
- +$progname: and run autoconf again.
- +_LT_EOF
- + fi
- + else
- + cat >&2 <<_LT_EOF
- +$progname: Version mismatch error. This is $PACKAGE $VERSION, revision $package_revision,
- +$progname: but the definition of this LT_INIT comes from revision $macro_revision.
- +$progname: You should recreate aclocal.m4 with macros from revision $package_revision
- +$progname: of $PACKAGE $VERSION and run autoconf again.
- +_LT_EOF
- + fi
- +
- + exit $EXIT_MISMATCH
- + fi
- +}
- +
- +
- +# Shorthand for --mode=foo, only valid as the first argument
- +case $1 in
- +clean|clea|cle|cl)
- + shift; set dummy --mode clean ${1+"$@"}; shift
- + ;;
- +compile|compil|compi|comp|com|co|c)
- + shift; set dummy --mode compile ${1+"$@"}; shift
- + ;;
- +execute|execut|execu|exec|exe|ex|e)
- + shift; set dummy --mode execute ${1+"$@"}; shift
- + ;;
- +finish|finis|fini|fin|fi|f)
- + shift; set dummy --mode finish ${1+"$@"}; shift
- + ;;
- +install|instal|insta|inst|ins|in|i)
- + shift; set dummy --mode install ${1+"$@"}; shift
- + ;;
- +link|lin|li|l)
- + shift; set dummy --mode link ${1+"$@"}; shift
- + ;;
- +uninstall|uninstal|uninsta|uninst|unins|unin|uni|un|u)
- + shift; set dummy --mode uninstall ${1+"$@"}; shift
- + ;;
- +esac
- +
- +
- +
- +# Option defaults:
- +opt_debug=:
- +opt_dry_run=false
- +opt_config=false
- +opt_preserve_dup_deps=false
- +opt_features=false
- +opt_finish=false
- +opt_help=false
- +opt_help_all=false
- +opt_silent=:
- +opt_verbose=:
- +opt_silent=false
- +opt_verbose=false
-
- - # Shorthand for --mode=foo, only valid as the first argument
- - case $1 in
- - clean|clea|cle|cl)
- - shift; set dummy --mode clean ${1+"$@"}; shift
- - ;;
- - compile|compil|compi|comp|com|co|c)
- - shift; set dummy --mode compile ${1+"$@"}; shift
- - ;;
- - execute|execut|execu|exec|exe|ex|e)
- - shift; set dummy --mode execute ${1+"$@"}; shift
- - ;;
- - finish|finis|fini|fin|fi|f)
- - shift; set dummy --mode finish ${1+"$@"}; shift
- - ;;
- - install|instal|insta|inst|ins|in|i)
- - shift; set dummy --mode install ${1+"$@"}; shift
- - ;;
- - link|lin|li|l)
- - shift; set dummy --mode link ${1+"$@"}; shift
- - ;;
- - uninstall|uninstal|uninsta|uninst|unins|unin|uni|un|u)
- - shift; set dummy --mode uninstall ${1+"$@"}; shift
- - ;;
- - esac
-
- - # Parse non-mode specific arguments:
- - while test "$#" -gt 0; do
- +# Parse options once, thoroughly. This comes as soon as possible in the
- +# script to make things like `--version' happen as quickly as we can.
- +{
- + # this just eases exit handling
- + while test $# -gt 0; do
- opt="$1"
- shift
- -
- case $opt in
- - --config) func_config ;;
- -
- - --debug) preserve_args="$preserve_args $opt"
- + --debug|-x) opt_debug='set -x'
- func_echo "enabling shell trace mode"
- - opt_debug='set -x'
- $opt_debug
- ;;
- -
- - -dlopen) test "$#" -eq 0 && func_missing_arg "$opt" && break
- - execute_dlfiles="$execute_dlfiles $1"
- - shift
- + --dry-run|--dryrun|-n)
- + opt_dry_run=:
- ;;
- -
- - --dry-run | -n) opt_dry_run=: ;;
- - --features) func_features ;;
- - --finish) mode="finish" ;;
- -
- - --mode) test "$#" -eq 0 && func_missing_arg "$opt" && break
- - case $1 in
- - # Valid mode arguments:
- - clean) ;;
- - compile) ;;
- - execute) ;;
- - finish) ;;
- - install) ;;
- - link) ;;
- - relink) ;;
- - uninstall) ;;
- -
- - # Catch anything else as an error
- - *) func_error "invalid argument for $opt"
- - exit_cmd=exit
- - break
- - ;;
- - esac
- -
- - mode="$1"
- + --config)
- + opt_config=:
- +func_config
- + ;;
- + --dlopen|-dlopen)
- + optarg="$1"
- + opt_dlopen="${opt_dlopen+$opt_dlopen
- +}$optarg"
- shift
- ;;
- -
- --preserve-dup-deps)
- - opt_duplicate_deps=: ;;
- -
- - --quiet|--silent) preserve_args="$preserve_args $opt"
- - opt_silent=:
- + opt_preserve_dup_deps=:
- ;;
- -
- - --verbose| -v) preserve_args="$preserve_args $opt"
- + --features)
- + opt_features=:
- +func_features
- + ;;
- + --finish)
- + opt_finish=:
- +set dummy --mode finish ${1+"$@"}; shift
- + ;;
- + --help)
- + opt_help=:
- + ;;
- + --help-all)
- + opt_help_all=:
- +opt_help=': help-all'
- + ;;
- + --mode)
- + test $# = 0 && func_missing_arg $opt && break
- + optarg="$1"
- + opt_mode="$optarg"
- +case $optarg in
- + # Valid mode arguments:
- + clean|compile|execute|finish|install|link|relink|uninstall) ;;
- +
- + # Catch anything else as an error
- + *) func_error "invalid argument for $opt"
- + exit_cmd=exit
- + break
- + ;;
- +esac
- + shift
- + ;;
- + --no-silent|--no-quiet)
- opt_silent=false
- +func_append preserve_args " $opt"
- ;;
- -
- - --tag) test "$#" -eq 0 && func_missing_arg "$opt" && break
- - preserve_args="$preserve_args $opt $1"
- - func_enable_tag "$1" # tagname is set here
- + --no-verbose)
- + opt_verbose=false
- +func_append preserve_args " $opt"
- + ;;
- + --silent|--quiet)
- + opt_silent=:
- +func_append preserve_args " $opt"
- + opt_verbose=false
- + ;;
- + --verbose|-v)
- + opt_verbose=:
- +func_append preserve_args " $opt"
- +opt_silent=false
- + ;;
- + --tag)
- + test $# = 0 && func_missing_arg $opt && break
- + optarg="$1"
- + opt_tag="$optarg"
- +func_append preserve_args " $opt $optarg"
- +func_enable_tag "$optarg"
- shift
- ;;
-
- + -\?|-h) func_usage ;;
- + --help) func_help ;;
- + --version) func_version ;;
- +
- # Separate optargs to long options:
- - -dlopen=*|--mode=*|--tag=*)
- - func_opt_split "$opt"
- - set dummy "$func_opt_split_opt" "$func_opt_split_arg" ${1+"$@"}
- + --*=*)
- + func_split_long_opt "$opt"
- + set dummy "$func_split_long_opt_name" "$func_split_long_opt_arg" ${1+"$@"}
- shift
- ;;
-
- - -\?|-h) func_usage ;;
- - --help) opt_help=: ;;
- - --version) func_version ;;
- -
- - -*) func_fatal_help "unrecognized option \`$opt'" ;;
- -
- - *) nonopt="$opt"
- - break
- + # Separate non-argument short options:
- + -\?*|-h*|-n*|-v*)
- + func_split_short_opt "$opt"
- + set dummy "$func_split_short_opt_name" "-$func_split_short_opt_arg" ${1+"$@"}
- + shift
- ;;
- +
- + --) break ;;
- + -*) func_fatal_help "unrecognized option \`$opt'" ;;
- + *) set dummy "$opt" ${1+"$@"}; shift; break ;;
- esac
- done
-
- + # Validate options:
- +
- + # save first non-option argument
- + if test "$#" -gt 0; then
- + nonopt="$opt"
- + shift
- + fi
- +
- + # preserve --debug
- + test "$opt_debug" = : || func_append preserve_args " --debug"
-
- case $host in
- *cygwin* | *mingw* | *pw32* | *cegcc*)
- @@ -955,82 +1184,44 @@ func_enable_tag ()
- opt_duplicate_compiler_generated_deps=:
- ;;
- *)
- - opt_duplicate_compiler_generated_deps=$opt_duplicate_deps
- + opt_duplicate_compiler_generated_deps=$opt_preserve_dup_deps
- ;;
- esac
-
- - # Having warned about all mis-specified options, bail out if
- - # anything was wrong.
- - $exit_cmd $EXIT_FAILURE
- -}
- + $opt_help || {
- + # Sanity checks first:
- + func_check_version_match
-
- -# func_check_version_match
- -# Ensure that we are using m4 macros, and libtool script from the same
- -# release of libtool.
- -func_check_version_match ()
- -{
- - if test "$package_revision" != "$macro_revision"; then
- - if test "$VERSION" != "$macro_version"; then
- - if test -z "$macro_version"; then
- - cat >&2 <<_LT_EOF
- -$progname: Version mismatch error. This is $PACKAGE $VERSION, but the
- -$progname: definition of this LT_INIT comes from an older release.
- -$progname: You should recreate aclocal.m4 with macros from $PACKAGE $VERSION
- -$progname: and run autoconf again.
- -_LT_EOF
- - else
- - cat >&2 <<_LT_EOF
- -$progname: Version mismatch error. This is $PACKAGE $VERSION, but the
- -$progname: definition of this LT_INIT comes from $PACKAGE $macro_version.
- -$progname: You should recreate aclocal.m4 with macros from $PACKAGE $VERSION
- -$progname: and run autoconf again.
- -_LT_EOF
- - fi
- - else
- - cat >&2 <<_LT_EOF
- -$progname: Version mismatch error. This is $PACKAGE $VERSION, revision $package_revision,
- -$progname: but the definition of this LT_INIT comes from revision $macro_revision.
- -$progname: You should recreate aclocal.m4 with macros from revision $package_revision
- -$progname: of $PACKAGE $VERSION and run autoconf again.
- -_LT_EOF
- + if test "$build_libtool_libs" != yes && test "$build_old_libs" != yes; then
- + func_fatal_configuration "not configured to build any kind of library"
- fi
-
- - exit $EXIT_MISMATCH
- - fi
- -}
- -
- + # Darwin sucks
- + eval std_shrext=\"$shrext_cmds\"
-
- -## ----------- ##
- -## Main. ##
- -## ----------- ##
- -
- -$opt_help || {
- - # Sanity checks first:
- - func_check_version_match
- -
- - if test "$build_libtool_libs" != yes && test "$build_old_libs" != yes; then
- - func_fatal_configuration "not configured to build any kind of library"
- - fi
- + # Only execute mode is allowed to have -dlopen flags.
- + if test -n "$opt_dlopen" && test "$opt_mode" != execute; then
- + func_error "unrecognized option \`-dlopen'"
- + $ECHO "$help" 1>&2
- + exit $EXIT_FAILURE
- + fi
-
- - test -z "$mode" && func_fatal_error "error: you must specify a MODE."
- + # Change the help message to a mode-specific one.
- + generic_help="$help"
- + help="Try \`$progname --help --mode=$opt_mode' for more information."
- + }
-
-
- - # Darwin sucks
- - eval std_shrext=\"$shrext_cmds\"
- + # Bail if the options were screwed
- + $exit_cmd $EXIT_FAILURE
- +}
-
-
- - # Only execute mode is allowed to have -dlopen flags.
- - if test -n "$execute_dlfiles" && test "$mode" != execute; then
- - func_error "unrecognized option \`-dlopen'"
- - $ECHO "$help" 1>&2
- - exit $EXIT_FAILURE
- - fi
-
- - # Change the help message to a mode-specific one.
- - generic_help="$help"
- - help="Try \`$progname --help --mode=$mode' for more information."
- -}
-
- +## ----------- ##
- +## Main. ##
- +## ----------- ##
-
- # func_lalib_p file
- # True iff FILE is a libtool `.la' library or `.lo' object file.
- @@ -1095,12 +1286,9 @@ func_ltwrapper_executable_p ()
- # temporary ltwrapper_script.
- func_ltwrapper_scriptname ()
- {
- - func_ltwrapper_scriptname_result=""
- - if func_ltwrapper_executable_p "$1"; then
- - func_dirname_and_basename "$1" "" "."
- - func_stripname '' '.exe' "$func_basename_result"
- - func_ltwrapper_scriptname_result="$func_dirname_result/$objdir/${func_stripname_result}_ltshwrapper"
- - fi
- + func_dirname_and_basename "$1" "" "."
- + func_stripname '' '.exe' "$func_basename_result"
- + func_ltwrapper_scriptname_result="$func_dirname_result/$objdir/${func_stripname_result}_ltshwrapper"
- }
-
- # func_ltwrapper_p file
- @@ -1146,6 +1334,37 @@ func_source ()
- }
-
-
- +# func_resolve_sysroot PATH
- +# Replace a leading = in PATH with a sysroot. Store the result into
- +# func_resolve_sysroot_result
- +func_resolve_sysroot ()
- +{
- + func_resolve_sysroot_result=$1
- + case $func_resolve_sysroot_result in
- + =*)
- + func_stripname '=' '' "$func_resolve_sysroot_result"
- + func_resolve_sysroot_result=$lt_sysroot$func_stripname_result
- + ;;
- + esac
- +}
- +
- +# func_replace_sysroot PATH
- +# If PATH begins with the sysroot, replace it with = and
- +# store the result into func_replace_sysroot_result.
- +func_replace_sysroot ()
- +{
- + case "$lt_sysroot:$1" in
- + ?*:"$lt_sysroot"*)
- + func_stripname "$lt_sysroot" '' "$1"
- + func_replace_sysroot_result="=$func_stripname_result"
- + ;;
- + *)
- + # Including no sysroot.
- + func_replace_sysroot_result=$1
- + ;;
- + esac
- +}
- +
- # func_infer_tag arg
- # Infer tagged configuration to use if any are available and
- # if one wasn't chosen via the "--tag" command line option.
- @@ -1158,13 +1377,15 @@ func_infer_tag ()
- if test -n "$available_tags" && test -z "$tagname"; then
- CC_quoted=
- for arg in $CC; do
- - func_quote_for_eval "$arg"
- - CC_quoted="$CC_quoted $func_quote_for_eval_result"
- + func_append_quoted CC_quoted "$arg"
- done
- + CC_expanded=`func_echo_all $CC`
- + CC_quoted_expanded=`func_echo_all $CC_quoted`
- case $@ in
- # Blanks in the command may have been stripped by the calling shell,
- # but not from the CC environment variable when configure was run.
- - " $CC "* | "$CC "* | " `$ECHO $CC` "* | "`$ECHO $CC` "* | " $CC_quoted"* | "$CC_quoted "* | " `$ECHO $CC_quoted` "* | "`$ECHO $CC_quoted` "*) ;;
- + " $CC "* | "$CC "* | " $CC_expanded "* | "$CC_expanded "* | \
- + " $CC_quoted"* | "$CC_quoted "* | " $CC_quoted_expanded "* | "$CC_quoted_expanded "*) ;;
- # Blanks at the start of $base_compile will cause this to fail
- # if we don't check for them as well.
- *)
- @@ -1175,11 +1396,13 @@ func_infer_tag ()
- CC_quoted=
- for arg in $CC; do
- # Double-quote args containing other shell metacharacters.
- - func_quote_for_eval "$arg"
- - CC_quoted="$CC_quoted $func_quote_for_eval_result"
- + func_append_quoted CC_quoted "$arg"
- done
- + CC_expanded=`func_echo_all $CC`
- + CC_quoted_expanded=`func_echo_all $CC_quoted`
- case "$@ " in
- - " $CC "* | "$CC "* | " `$ECHO $CC` "* | "`$ECHO $CC` "* | " $CC_quoted"* | "$CC_quoted "* | " `$ECHO $CC_quoted` "* | "`$ECHO $CC_quoted` "*)
- + " $CC "* | "$CC "* | " $CC_expanded "* | "$CC_expanded "* | \
- + " $CC_quoted"* | "$CC_quoted "* | " $CC_quoted_expanded "* | "$CC_quoted_expanded "*)
- # The compiler in the base compile command matches
- # the one in the tagged configuration.
- # Assume this is the tagged configuration we want.
- @@ -1242,6 +1465,486 @@ EOF
- }
- }
-
- +
- +##################################################
- +# FILE NAME AND PATH CONVERSION HELPER FUNCTIONS #
- +##################################################
- +
- +# func_convert_core_file_wine_to_w32 ARG
- +# Helper function used by file name conversion functions when $build is *nix,
- +# and $host is mingw, cygwin, or some other w32 environment. Relies on a
- +# correctly configured wine environment available, with the winepath program
- +# in $build's $PATH.
- +#
- +# ARG is the $build file name to be converted to w32 format.
- +# Result is available in $func_convert_core_file_wine_to_w32_result, and will
- +# be empty on error (or when ARG is empty)
- +func_convert_core_file_wine_to_w32 ()
- +{
- + $opt_debug
- + func_convert_core_file_wine_to_w32_result="$1"
- + if test -n "$1"; then
- + # Unfortunately, winepath does not exit with a non-zero error code, so we
- + # are forced to check the contents of stdout. On the other hand, if the
- + # command is not found, the shell will set an exit code of 127 and print
- + # *an error message* to stdout. So we must check for both error code of
- + # zero AND non-empty stdout, which explains the odd construction:
- + func_convert_core_file_wine_to_w32_tmp=`winepath -w "$1" 2>/dev/null`
- + if test "$?" -eq 0 && test -n "${func_convert_core_file_wine_to_w32_tmp}"; then
- + func_convert_core_file_wine_to_w32_result=`$ECHO "$func_convert_core_file_wine_to_w32_tmp" |
- + $SED -e "$lt_sed_naive_backslashify"`
- + else
- + func_convert_core_file_wine_to_w32_result=
- + fi
- + fi
- +}
- +# end: func_convert_core_file_wine_to_w32
- +
- +
- +# func_convert_core_path_wine_to_w32 ARG
- +# Helper function used by path conversion functions when $build is *nix, and
- +# $host is mingw, cygwin, or some other w32 environment. Relies on a correctly
- +# configured wine environment available, with the winepath program in $build's
- +# $PATH. Assumes ARG has no leading or trailing path separator characters.
- +#
- +# ARG is path to be converted from $build format to win32.
- +# Result is available in $func_convert_core_path_wine_to_w32_result.
- +# Unconvertible file (directory) names in ARG are skipped; if no directory names
- +# are convertible, then the result may be empty.
- +func_convert_core_path_wine_to_w32 ()
- +{
- + $opt_debug
- + # unfortunately, winepath doesn't convert paths, only file names
- + func_convert_core_path_wine_to_w32_result=""
- + if test -n "$1"; then
- + oldIFS=$IFS
- + IFS=:
- + for func_convert_core_path_wine_to_w32_f in $1; do
- + IFS=$oldIFS
- + func_convert_core_file_wine_to_w32 "$func_convert_core_path_wine_to_w32_f"
- + if test -n "$func_convert_core_file_wine_to_w32_result" ; then
- + if test -z "$func_convert_core_path_wine_to_w32_result"; then
- + func_convert_core_path_wine_to_w32_result="$func_convert_core_file_wine_to_w32_result"
- + else
- + func_append func_convert_core_path_wine_to_w32_result ";$func_convert_core_file_wine_to_w32_result"
- + fi
- + fi
- + done
- + IFS=$oldIFS
- + fi
- +}
- +# end: func_convert_core_path_wine_to_w32
- +
- +
- +# func_cygpath ARGS...
- +# Wrapper around calling the cygpath program via LT_CYGPATH. This is used when
- +# when (1) $build is *nix and Cygwin is hosted via a wine environment; or (2)
- +# $build is MSYS and $host is Cygwin, or (3) $build is Cygwin. In case (1) or
- +# (2), returns the Cygwin file name or path in func_cygpath_result (input
- +# file name or path is assumed to be in w32 format, as previously converted
- +# from $build's *nix or MSYS format). In case (3), returns the w32 file name
- +# or path in func_cygpath_result (input file name or path is assumed to be in
- +# Cygwin format). Returns an empty string on error.
- +#
- +# ARGS are passed to cygpath, with the last one being the file name or path to
- +# be converted.
- +#
- +# Specify the absolute *nix (or w32) name to cygpath in the LT_CYGPATH
- +# environment variable; do not put it in $PATH.
- +func_cygpath ()
- +{
- + $opt_debug
- + if test -n "$LT_CYGPATH" && test -f "$LT_CYGPATH"; then
- + func_cygpath_result=`$LT_CYGPATH "$@" 2>/dev/null`
- + if test "$?" -ne 0; then
- + # on failure, ensure result is empty
- + func_cygpath_result=
- + fi
- + else
- + func_cygpath_result=
- + func_error "LT_CYGPATH is empty or specifies non-existent file: \`$LT_CYGPATH'"
- + fi
- +}
- +#end: func_cygpath
- +
- +
- +# func_convert_core_msys_to_w32 ARG
- +# Convert file name or path ARG from MSYS format to w32 format. Return
- +# result in func_convert_core_msys_to_w32_result.
- +func_convert_core_msys_to_w32 ()
- +{
- + $opt_debug
- + # awkward: cmd appends spaces to result
- + func_convert_core_msys_to_w32_result=`( cmd //c echo "$1" ) 2>/dev/null |
- + $SED -e 's/[ ]*$//' -e "$lt_sed_naive_backslashify"`
- +}
- +#end: func_convert_core_msys_to_w32
- +
- +
- +# func_convert_file_check ARG1 ARG2
- +# Verify that ARG1 (a file name in $build format) was converted to $host
- +# format in ARG2. Otherwise, emit an error message, but continue (resetting
- +# func_to_host_file_result to ARG1).
- +func_convert_file_check ()
- +{
- + $opt_debug
- + if test -z "$2" && test -n "$1" ; then
- + func_error "Could not determine host file name corresponding to"
- + func_error " \`$1'"
- + func_error "Continuing, but uninstalled executables may not work."
- + # Fallback:
- + func_to_host_file_result="$1"
- + fi
- +}
- +# end func_convert_file_check
- +
- +
- +# func_convert_path_check FROM_PATHSEP TO_PATHSEP FROM_PATH TO_PATH
- +# Verify that FROM_PATH (a path in $build format) was converted to $host
- +# format in TO_PATH. Otherwise, emit an error message, but continue, resetting
- +# func_to_host_file_result to a simplistic fallback value (see below).
- +func_convert_path_check ()
- +{
- + $opt_debug
- + if test -z "$4" && test -n "$3"; then
- + func_error "Could not determine the host path corresponding to"
- + func_error " \`$3'"
- + func_error "Continuing, but uninstalled executables may not work."
- + # Fallback. This is a deliberately simplistic "conversion" and
- + # should not be "improved". See libtool.info.
- + if test "x$1" != "x$2"; then
- + lt_replace_pathsep_chars="s|$1|$2|g"
- + func_to_host_path_result=`echo "$3" |
- + $SED -e "$lt_replace_pathsep_chars"`
- + else
- + func_to_host_path_result="$3"
- + fi
- + fi
- +}
- +# end func_convert_path_check
- +
- +
- +# func_convert_path_front_back_pathsep FRONTPAT BACKPAT REPL ORIG
- +# Modifies func_to_host_path_result by prepending REPL if ORIG matches FRONTPAT
- +# and appending REPL if ORIG matches BACKPAT.
- +func_convert_path_front_back_pathsep ()
- +{
- + $opt_debug
- + case $4 in
- + $1 ) func_to_host_path_result="$3$func_to_host_path_result"
- + ;;
- + esac
- + case $4 in
- + $2 ) func_append func_to_host_path_result "$3"
- + ;;
- + esac
- +}
- +# end func_convert_path_front_back_pathsep
- +
- +
- +##################################################
- +# $build to $host FILE NAME CONVERSION FUNCTIONS #
- +##################################################
- +# invoked via `$to_host_file_cmd ARG'
- +#
- +# In each case, ARG is the path to be converted from $build to $host format.
- +# Result will be available in $func_to_host_file_result.
- +
- +
- +# func_to_host_file ARG
- +# Converts the file name ARG from $build format to $host format. Return result
- +# in func_to_host_file_result.
- +func_to_host_file ()
- +{
- + $opt_debug
- + $to_host_file_cmd "$1"
- +}
- +# end func_to_host_file
- +
- +
- +# func_to_tool_file ARG LAZY
- +# converts the file name ARG from $build format to toolchain format. Return
- +# result in func_to_tool_file_result. If the conversion in use is listed
- +# in (the comma separated) LAZY, no conversion takes place.
- +func_to_tool_file ()
- +{
- + $opt_debug
- + case ,$2, in
- + *,"$to_tool_file_cmd",*)
- + func_to_tool_file_result=$1
- + ;;
- + *)
- + $to_tool_file_cmd "$1"
- + func_to_tool_file_result=$func_to_host_file_result
- + ;;
- + esac
- +}
- +# end func_to_tool_file
- +
- +
- +# func_convert_file_noop ARG
- +# Copy ARG to func_to_host_file_result.
- +func_convert_file_noop ()
- +{
- + func_to_host_file_result="$1"
- +}
- +# end func_convert_file_noop
- +
- +
- +# func_convert_file_msys_to_w32 ARG
- +# Convert file name ARG from (mingw) MSYS to (mingw) w32 format; automatic
- +# conversion to w32 is not available inside the cwrapper. Returns result in
- +# func_to_host_file_result.
- +func_convert_file_msys_to_w32 ()
- +{
- + $opt_debug
- + func_to_host_file_result="$1"
- + if test -n "$1"; then
- + func_convert_core_msys_to_w32 "$1"
- + func_to_host_file_result="$func_convert_core_msys_to_w32_result"
- + fi
- + func_convert_file_check "$1" "$func_to_host_file_result"
- +}
- +# end func_convert_file_msys_to_w32
- +
- +
- +# func_convert_file_cygwin_to_w32 ARG
- +# Convert file name ARG from Cygwin to w32 format. Returns result in
- +# func_to_host_file_result.
- +func_convert_file_cygwin_to_w32 ()
- +{
- + $opt_debug
- + func_to_host_file_result="$1"
- + if test -n "$1"; then
- + # because $build is cygwin, we call "the" cygpath in $PATH; no need to use
- + # LT_CYGPATH in this case.
- + func_to_host_file_result=`cygpath -m "$1"`
- + fi
- + func_convert_file_check "$1" "$func_to_host_file_result"
- +}
- +# end func_convert_file_cygwin_to_w32
- +
- +
- +# func_convert_file_nix_to_w32 ARG
- +# Convert file name ARG from *nix to w32 format. Requires a wine environment
- +# and a working winepath. Returns result in func_to_host_file_result.
- +func_convert_file_nix_to_w32 ()
- +{
- + $opt_debug
- + func_to_host_file_result="$1"
- + if test -n "$1"; then
- + func_convert_core_file_wine_to_w32 "$1"
- + func_to_host_file_result="$func_convert_core_file_wine_to_w32_result"
- + fi
- + func_convert_file_check "$1" "$func_to_host_file_result"
- +}
- +# end func_convert_file_nix_to_w32
- +
- +
- +# func_convert_file_msys_to_cygwin ARG
- +# Convert file name ARG from MSYS to Cygwin format. Requires LT_CYGPATH set.
- +# Returns result in func_to_host_file_result.
- +func_convert_file_msys_to_cygwin ()
- +{
- + $opt_debug
- + func_to_host_file_result="$1"
- + if test -n "$1"; then
- + func_convert_core_msys_to_w32 "$1"
- + func_cygpath -u "$func_convert_core_msys_to_w32_result"
- + func_to_host_file_result="$func_cygpath_result"
- + fi
- + func_convert_file_check "$1" "$func_to_host_file_result"
- +}
- +# end func_convert_file_msys_to_cygwin
- +
- +
- +# func_convert_file_nix_to_cygwin ARG
- +# Convert file name ARG from *nix to Cygwin format. Requires Cygwin installed
- +# in a wine environment, working winepath, and LT_CYGPATH set. Returns result
- +# in func_to_host_file_result.
- +func_convert_file_nix_to_cygwin ()
- +{
- + $opt_debug
- + func_to_host_file_result="$1"
- + if test -n "$1"; then
- + # convert from *nix to w32, then use cygpath to convert from w32 to cygwin.
- + func_convert_core_file_wine_to_w32 "$1"
- + func_cygpath -u "$func_convert_core_file_wine_to_w32_result"
- + func_to_host_file_result="$func_cygpath_result"
- + fi
- + func_convert_file_check "$1" "$func_to_host_file_result"
- +}
- +# end func_convert_file_nix_to_cygwin
- +
- +
- +#############################################
- +# $build to $host PATH CONVERSION FUNCTIONS #
- +#############################################
- +# invoked via `$to_host_path_cmd ARG'
- +#
- +# In each case, ARG is the path to be converted from $build to $host format.
- +# The result will be available in $func_to_host_path_result.
- +#
- +# Path separators are also converted from $build format to $host format. If
- +# ARG begins or ends with a path separator character, it is preserved (but
- +# converted to $host format) on output.
- +#
- +# All path conversion functions are named using the following convention:
- +# file name conversion function : func_convert_file_X_to_Y ()
- +# path conversion function : func_convert_path_X_to_Y ()
- +# where, for any given $build/$host combination the 'X_to_Y' value is the
- +# same. If conversion functions are added for new $build/$host combinations,
- +# the two new functions must follow this pattern, or func_init_to_host_path_cmd
- +# will break.
- +
- +
- +# func_init_to_host_path_cmd
- +# Ensures that function "pointer" variable $to_host_path_cmd is set to the
- +# appropriate value, based on the value of $to_host_file_cmd.
- +to_host_path_cmd=
- +func_init_to_host_path_cmd ()
- +{
- + $opt_debug
- + if test -z "$to_host_path_cmd"; then
- + func_stripname 'func_convert_file_' '' "$to_host_file_cmd"
- + to_host_path_cmd="func_convert_path_${func_stripname_result}"
- + fi
- +}
- +
- +
- +# func_to_host_path ARG
- +# Converts the path ARG from $build format to $host format. Return result
- +# in func_to_host_path_result.
- +func_to_host_path ()
- +{
- + $opt_debug
- + func_init_to_host_path_cmd
- + $to_host_path_cmd "$1"
- +}
- +# end func_to_host_path
- +
- +
- +# func_convert_path_noop ARG
- +# Copy ARG to func_to_host_path_result.
- +func_convert_path_noop ()
- +{
- + func_to_host_path_result="$1"
- +}
- +# end func_convert_path_noop
- +
- +
- +# func_convert_path_msys_to_w32 ARG
- +# Convert path ARG from (mingw) MSYS to (mingw) w32 format; automatic
- +# conversion to w32 is not available inside the cwrapper. Returns result in
- +# func_to_host_path_result.
- +func_convert_path_msys_to_w32 ()
- +{
- + $opt_debug
- + func_to_host_path_result="$1"
- + if test -n "$1"; then
- + # Remove leading and trailing path separator characters from ARG. MSYS
- + # behavior is inconsistent here; cygpath turns them into '.;' and ';.';
- + # and winepath ignores them completely.
- + func_stripname : : "$1"
- + func_to_host_path_tmp1=$func_stripname_result
- + func_convert_core_msys_to_w32 "$func_to_host_path_tmp1"
- + func_to_host_path_result="$func_convert_core_msys_to_w32_result"
- + func_convert_path_check : ";" \
- + "$func_to_host_path_tmp1" "$func_to_host_path_result"
- + func_convert_path_front_back_pathsep ":*" "*:" ";" "$1"
- + fi
- +}
- +# end func_convert_path_msys_to_w32
- +
- +
- +# func_convert_path_cygwin_to_w32 ARG
- +# Convert path ARG from Cygwin to w32 format. Returns result in
- +# func_to_host_file_result.
- +func_convert_path_cygwin_to_w32 ()
- +{
- + $opt_debug
- + func_to_host_path_result="$1"
- + if test -n "$1"; then
- + # See func_convert_path_msys_to_w32:
- + func_stripname : : "$1"
- + func_to_host_path_tmp1=$func_stripname_result
- + func_to_host_path_result=`cygpath -m -p "$func_to_host_path_tmp1"`
- + func_convert_path_check : ";" \
- + "$func_to_host_path_tmp1" "$func_to_host_path_result"
- + func_convert_path_front_back_pathsep ":*" "*:" ";" "$1"
- + fi
- +}
- +# end func_convert_path_cygwin_to_w32
- +
- +
- +# func_convert_path_nix_to_w32 ARG
- +# Convert path ARG from *nix to w32 format. Requires a wine environment and
- +# a working winepath. Returns result in func_to_host_file_result.
- +func_convert_path_nix_to_w32 ()
- +{
- + $opt_debug
- + func_to_host_path_result="$1"
- + if test -n "$1"; then
- + # See func_convert_path_msys_to_w32:
- + func_stripname : : "$1"
- + func_to_host_path_tmp1=$func_stripname_result
- + func_convert_core_path_wine_to_w32 "$func_to_host_path_tmp1"
- + func_to_host_path_result="$func_convert_core_path_wine_to_w32_result"
- + func_convert_path_check : ";" \
- + "$func_to_host_path_tmp1" "$func_to_host_path_result"
- + func_convert_path_front_back_pathsep ":*" "*:" ";" "$1"
- + fi
- +}
- +# end func_convert_path_nix_to_w32
- +
- +
- +# func_convert_path_msys_to_cygwin ARG
- +# Convert path ARG from MSYS to Cygwin format. Requires LT_CYGPATH set.
- +# Returns result in func_to_host_file_result.
- +func_convert_path_msys_to_cygwin ()
- +{
- + $opt_debug
- + func_to_host_path_result="$1"
- + if test -n "$1"; then
- + # See func_convert_path_msys_to_w32:
- + func_stripname : : "$1"
- + func_to_host_path_tmp1=$func_stripname_result
- + func_convert_core_msys_to_w32 "$func_to_host_path_tmp1"
- + func_cygpath -u -p "$func_convert_core_msys_to_w32_result"
- + func_to_host_path_result="$func_cygpath_result"
- + func_convert_path_check : : \
- + "$func_to_host_path_tmp1" "$func_to_host_path_result"
- + func_convert_path_front_back_pathsep ":*" "*:" : "$1"
- + fi
- +}
- +# end func_convert_path_msys_to_cygwin
- +
- +
- +# func_convert_path_nix_to_cygwin ARG
- +# Convert path ARG from *nix to Cygwin format. Requires Cygwin installed in a
- +# a wine environment, working winepath, and LT_CYGPATH set. Returns result in
- +# func_to_host_file_result.
- +func_convert_path_nix_to_cygwin ()
- +{
- + $opt_debug
- + func_to_host_path_result="$1"
- + if test -n "$1"; then
- + # Remove leading and trailing path separator characters from
- + # ARG. msys beha