mirror of
git://git.savannah.gnu.org/libtool.git
synced 2025-02-05 14:40:42 +08:00
Rename _LT_PROG_XSI_REPLACE macro to _LT_PROG_FUNCTION_REPLACE.
* libltdl/m4/libtool.m4 (_LT_PROG_XSI_SHELLFNS): Rename to _LT_PROG_REPLACE_SHELLFNS. (_LT_PROG_XSI_REPLACE): Rename to _LT_PROG_FUNCTION_REPLACE. (_LT_PROG_FUNCTION_REPLACE): Change decorator comment to use 'Extended shell' rather than 'XSI' on successful replacement. * libltdl/config/general.m4sh (func_dirname, func_basename) (func_dirname_and_basename, func_stripname): Change decorator comment to use 'extended shell' rather than 'XSI' on fallback implementations. * libltdl/config/getopt.m4sh (func_split_short_opt) (func_split_long_opt): Ditto. * libltdl/config/ltmain.m4sh (func_append, func_append_quoted) (func_arith, func_len, func_lo2o, func_xform): Ditto. * tests/getopt-m4sh.at (_LT_AT_XSI_FUNC_EXTRACT): Rename to _LT_AT_EXTENDED_SHELL_FUNC_EXTRACT. (_LT_AT_EXTENDED_SHELL_FUNC_EXTRACT): Change regular expression to match new replacable function decorator comments. Signed-off-by: Gary V. Vaughan <gary@gnu.org>
This commit is contained in:
parent
3f22cab581
commit
de8a0992b2
19
ChangeLog
19
ChangeLog
@ -7,6 +7,25 @@
|
||||
|
||||
2010-07-08 Gary V. Vaughan <gary@gnu.org>
|
||||
|
||||
Rename _LT_PROG_XSI_REPLACE macro to _LT_PROG_FUNCTION_REPLACE.
|
||||
* libltdl/m4/libtool.m4 (_LT_PROG_XSI_SHELLFNS): Rename to
|
||||
_LT_PROG_REPLACE_SHELLFNS.
|
||||
(_LT_PROG_XSI_REPLACE): Rename to _LT_PROG_FUNCTION_REPLACE.
|
||||
(_LT_PROG_FUNCTION_REPLACE): Change decorator comment to use
|
||||
'Extended shell' rather than 'XSI' on successful replacement.
|
||||
* libltdl/config/general.m4sh (func_dirname, func_basename)
|
||||
(func_dirname_and_basename, func_stripname): Change decorator
|
||||
comment to use 'extended shell' rather than 'XSI' on fallback
|
||||
implementations.
|
||||
* libltdl/config/getopt.m4sh (func_split_short_opt)
|
||||
(func_split_long_opt): Ditto.
|
||||
* libltdl/config/ltmain.m4sh (func_append, func_append_quoted)
|
||||
(func_arith, func_len, func_lo2o, func_xform): Ditto.
|
||||
* tests/getopt-m4sh.at (_LT_AT_XSI_FUNC_EXTRACT): Rename to
|
||||
_LT_AT_EXTENDED_SHELL_FUNC_EXTRACT.
|
||||
(_LT_AT_EXTENDED_SHELL_FUNC_EXTRACT): Change regular expression to
|
||||
match new replacable function decorator comments.
|
||||
|
||||
Fix a cut-n-pasto in "2010-07-07 Charles Wilson" patch.
|
||||
* libltdl/config/ltmain.m4sh (func_mode_link): Remove spurious
|
||||
variable dereference.
|
||||
|
@ -84,14 +84,14 @@ func_dirname ()
|
||||
else
|
||||
func_dirname_result="$func_dirname_result${2}"
|
||||
fi
|
||||
} # func_dirname may be replaced by XSI optimised implementation
|
||||
} # 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 XSI optimised implementation
|
||||
} # func_basename may be replaced by extended shell implementation
|
||||
|
||||
|
||||
# func_dirname_and_basename file append nondir_replacement
|
||||
@ -116,7 +116,7 @@ func_dirname_and_basename ()
|
||||
func_dirname_result="$func_dirname_result${2}"
|
||||
fi
|
||||
func_basename_result=`$ECHO "${1}" | $SED -e "$basename"`
|
||||
} # func_dirname_and_basename may be replaced by XSI optimised implementation
|
||||
} # func_dirname_and_basename may be replaced by extended shell implementation
|
||||
|
||||
|
||||
# func_stripname prefix suffix name
|
||||
@ -131,7 +131,7 @@ func_stripname ()
|
||||
.*) 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 XSI optimised implementation
|
||||
} # func_stripname may be replaced by extended shell implementation
|
||||
|
||||
|
||||
# These SED scripts presuppose an absolute path with a trailing slash.
|
||||
|
@ -628,7 +628,7 @@ func_split_short_opt ()
|
||||
|
||||
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 XSI optimised implementation
|
||||
} # func_split_short_opt may be replaced by extended shell implementation
|
||||
|
||||
|
||||
# func_split_long_opt longopt
|
||||
@ -641,7 +641,7 @@ func_split_long_opt ()
|
||||
|
||||
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 XSI optimised implementation
|
||||
} # func_split_long_opt may be replaced by extended shell implementation
|
||||
|
||||
exit_cmd=:
|
||||
]])
|
||||
|
@ -154,7 +154,7 @@ exec_cmd=
|
||||
func_append ()
|
||||
{
|
||||
eval "${1}=\$${1}\${2}"
|
||||
} # func_append may be replaced by XSI optimised implementation
|
||||
} # 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.
|
||||
@ -162,14 +162,14 @@ func_append_quoted ()
|
||||
{
|
||||
func_quote_for_eval "${2}"
|
||||
eval "${1}=\$${1}\\ \$func_quote_for_eval_result"
|
||||
} # func_append_quoted may be replaced by XSI optimised implementation
|
||||
} # 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 XSI optimised implementation
|
||||
} # func_arith may be replaced by extended shell implementation
|
||||
|
||||
|
||||
# func_len string
|
||||
@ -177,21 +177,21 @@ func_arith ()
|
||||
func_len ()
|
||||
{
|
||||
func_len_result=`expr "${1}" : ".*" 2>/dev/null || echo $max_cmd_len`
|
||||
} # func_len may be replaced by XSI optimised implementation
|
||||
} # 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 XSI optimised implementation
|
||||
} # 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 XSI optimised implementation
|
||||
} # func_xform may be replaced by extended shell implementation
|
||||
|
||||
|
||||
# func_fatal_configuration arg...
|
||||
|
52
libltdl/m4/libtool.m4
vendored
52
libltdl/m4/libtool.m4
vendored
@ -752,7 +752,7 @@ _LT_EOF
|
||||
sed '$q' "$ltmain" >> "$cfgfile" \
|
||||
|| (rm -f "$cfgfile"; exit 1)
|
||||
|
||||
_LT_PROG_XSI_SHELLFNS
|
||||
_LT_PROG_REPLACE_SHELLFNS
|
||||
|
||||
mv -f "$cfgfile" "$ofile" ||
|
||||
(rm -f "$ofile" && cp "$cfgfile" "$ofile" && rm -f "$cfgfile")
|
||||
@ -7453,77 +7453,77 @@ _LT_DECL([NL2SP], [lt_NL2SP], [1], [turn newlines into spaces])dnl
|
||||
])# _LT_CHECK_SHELL_FEATURES
|
||||
|
||||
|
||||
# _LT_PROG_XSI_REPLACE (FUNCNAME, REPLACEMENT-BODY)
|
||||
# -------------------------------------------------
|
||||
# _LT_PROG_FUNCTION_REPLACE (FUNCNAME, REPLACEMENT-BODY)
|
||||
# ------------------------------------------------------
|
||||
# In `$cfgfile', look for function FUNCNAME delimited by `^FUNCNAME ()$' and
|
||||
# '^} FUNCNAME ', and replace its body with REPLACEMENT-BODY.
|
||||
m4_defun([_LT_PROG_XSI_REPLACE],
|
||||
m4_defun([_LT_PROG_FUNCTION_REPLACE],
|
||||
[dnl {
|
||||
sed -e '/^$1 ()$/,/^} # $1 /c\
|
||||
$1 ()\
|
||||
{\
|
||||
m4_bpatsubsts([$2], [$], [\\], [^\([ ]\)], [\\\1])
|
||||
} # XSI $1 implementation' "$cfgfile" > $cfgfile.tmp \
|
||||
} # Extended-shell $1 implementation' "$cfgfile" > $cfgfile.tmp \
|
||||
&& mv -f "$cfgfile.tmp" "$cfgfile" \
|
||||
|| (rm -f "$cfgfile" && cp "$cfgfile.tmp" "$cfgfile" && rm -f "$cfgfile.tmp")
|
||||
test 0 -eq $? || _lt_xsi_replace_fail=:
|
||||
test 0 -eq $? || _lt_function_replace_fail=:
|
||||
])
|
||||
|
||||
|
||||
# _LT_PROG_XSI_SHELLFNS
|
||||
# ---------------------
|
||||
# _LT_PROG_REPLACE_SHELLFNS
|
||||
# -------------------------
|
||||
# Replace existing portable implementations of several shell functions with
|
||||
# equivalent XSI compatible implementations.
|
||||
m4_defun([_LT_PROG_XSI_SHELLFNS],
|
||||
# equivalent extended shell implementations where those features are available..
|
||||
m4_defun([_LT_PROG_REPLACE_SHELLFNS],
|
||||
[if test x"$xsi_shell" = xyes; then
|
||||
_LT_PROG_XSI_REPLACE([func_dirname], [dnl
|
||||
_LT_PROG_FUNCTION_REPLACE([func_dirname], [dnl
|
||||
case ${1} in
|
||||
*/*) func_dirname_result="${1%/*}${2}" ;;
|
||||
* ) func_dirname_result="${3}" ;;
|
||||
esac])
|
||||
|
||||
_LT_PROG_XSI_REPLACE([func_basename], [dnl
|
||||
_LT_PROG_FUNCTION_REPLACE([func_basename], [dnl
|
||||
func_basename_result="${1##*/}"])
|
||||
|
||||
_LT_PROG_XSI_REPLACE([func_dirname_and_basename], [dnl
|
||||
_LT_PROG_FUNCTION_REPLACE([func_dirname_and_basename], [dnl
|
||||
case ${1} in
|
||||
*/*) func_dirname_result="${1%/*}${2}" ;;
|
||||
* ) func_dirname_result="${3}" ;;
|
||||
esac
|
||||
func_basename_result="${1##*/}"])
|
||||
|
||||
_LT_PROG_XSI_REPLACE([func_stripname], [dnl
|
||||
_LT_PROG_FUNCTION_REPLACE([func_stripname], [dnl
|
||||
# pdksh 5.2.14 does not do ${X%$Y} correctly if both X and Y are
|
||||
# positional parameters, so assign one to ordinary parameter first.
|
||||
func_stripname_result=${3}
|
||||
func_stripname_result=${func_stripname_result#"${1}"}
|
||||
func_stripname_result=${func_stripname_result%"${2}"}])
|
||||
|
||||
_LT_PROG_XSI_REPLACE([func_split_long_opt], [dnl
|
||||
_LT_PROG_FUNCTION_REPLACE([func_split_long_opt], [dnl
|
||||
func_split_long_opt_name=${1%%=*}
|
||||
func_split_long_opt_arg=${1#*=}])
|
||||
|
||||
_LT_PROG_XSI_REPLACE([func_split_short_opt], [dnl
|
||||
_LT_PROG_FUNCTION_REPLACE([func_split_short_opt], [dnl
|
||||
func_split_short_opt_arg=${1#??}
|
||||
func_split_short_opt_name=${1%"$func_split_short_opt_arg"}])
|
||||
|
||||
_LT_PROG_XSI_REPLACE([func_lo2o], [dnl
|
||||
_LT_PROG_FUNCTION_REPLACE([func_lo2o], [dnl
|
||||
case ${1} in
|
||||
*.lo) func_lo2o_result=${1%.lo}.${objext} ;;
|
||||
*) func_lo2o_result=${1} ;;
|
||||
esac])
|
||||
|
||||
_LT_PROG_XSI_REPLACE([func_xform], [ func_xform_result=${1%.*}.lo])
|
||||
_LT_PROG_FUNCTION_REPLACE([func_xform], [ func_xform_result=${1%.*}.lo])
|
||||
|
||||
_LT_PROG_XSI_REPLACE([func_arith], [ func_arith_result=$(( $[*] ))])
|
||||
_LT_PROG_FUNCTION_REPLACE([func_arith], [ func_arith_result=$(( $[*] ))])
|
||||
|
||||
_LT_PROG_XSI_REPLACE([func_len], [ func_len_result=${#1}])
|
||||
_LT_PROG_FUNCTION_REPLACE([func_len], [ func_len_result=${#1}])
|
||||
fi
|
||||
|
||||
if test x"$lt_shell_append" = xyes; then
|
||||
_LT_PROG_XSI_REPLACE([func_append], [ eval "${1}+=\\${2}"])
|
||||
_LT_PROG_FUNCTION_REPLACE([func_append], [ eval "${1}+=\\${2}"])
|
||||
|
||||
_LT_PROG_XSI_REPLACE([func_append_quoted], [dnl
|
||||
_LT_PROG_FUNCTION_REPLACE([func_append_quoted], [dnl
|
||||
func_quote_for_eval "${2}"
|
||||
dnl m4 expansion turns \\\\ into \\, and then the shell eval turns that into \
|
||||
eval "${1}+=\\\\ \\$func_quote_for_eval_result"])
|
||||
@ -7532,16 +7532,16 @@ dnl m4 expansion turns \\\\ into \\, and then the shell eval turns that into \
|
||||
sed -e 's%func_append \([[a-zA-Z_]]\{1,\}\) "%\1+="%g' $cfgfile > $cfgfile.tmp \
|
||||
&& mv -f "$cfgfile.tmp" "$cfgfile" \
|
||||
|| (rm -f "$cfgfile" && cp "$cfgfile.tmp" "$cfgfile" && rm -f "$cfgfile.tmp")
|
||||
test 0 -eq $? || _lt_xsi_replace_fail=:
|
||||
test 0 -eq $? || _lt_function_replace_fail=:
|
||||
else
|
||||
# Save a `func_append' function call even when '+=' is not available
|
||||
sed -e 's%func_append \([[a-zA-Z_]]\{1,\}\) "%\1="$\1%g' $cfgfile > $cfgfile.tmp \
|
||||
&& mv -f "$cfgfile.tmp" "$cfgfile" \
|
||||
|| (rm -f "$cfgfile" && cp "$cfgfile.tmp" "$cfgfile" && rm -f "$cfgfile.tmp")
|
||||
test 0 -eq $? || _lt_xsi_replace_fail=:
|
||||
test 0 -eq $? || _lt_function_replace_fail=:
|
||||
fi
|
||||
|
||||
if test x"$_lt_xsi_replace_fail" = x":"; then
|
||||
AC_MSG_WARN([Unable to substitute faster XSI functions in $ofile])
|
||||
if test x"$_lt_function_replace_fail" = x":"; then
|
||||
AC_MSG_WARN([Unable to substitute extended shell functions in $ofile])
|
||||
fi
|
||||
])
|
||||
|
@ -69,13 +69,13 @@ $SED '1,/^# func_dirname/d' options >> options.tmp
|
||||
rm -f options && mv options.tmp options])
|
||||
|
||||
|
||||
# _LT_AT_XSI_FUNC_EXTRACT(FUNC-NAME)
|
||||
# ----------------------------------
|
||||
# Extract the XSI decorated function FUNC-NAME from libtool
|
||||
# _LT_AT_EXTENDED_SHELL_FUNC_EXTRACT(FUNC-NAME)
|
||||
# ---------------------------------------------
|
||||
# Extract the 'Extended-shell'-decorated function FUNC-NAME from libtool
|
||||
m4_define([_LT_AT_XSI_FUNC_EXTRACT],
|
||||
[dnl {{
|
||||
$SED '/^# $1/q' options > options.tmp
|
||||
$SED -n '/^$1 ()/,/^} # XSI $1 /p' $abs_top_builddir/libtool >> options.tmp
|
||||
$SED -n '/^$1 ()/,/^} # Extended-shell $1 /p' $abs_top_builddir/libtool >> options.tmp
|
||||
$SED '1,/^} # $1 /d' options >> options.tmp
|
||||
rm -f options && mv options.tmp options])
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user