mirror of
git://git.savannah.gnu.org/libtool.git
synced 2025-02-17 15:10:02 +08:00
* libltdl/m4/libtool.m4 (func_dirname_and_basename) <XSI>:
New function. (func_dirname_and_basename) <!XSI>: New function. * libltdl/config/ltmain.m4sh (func_ltwrapper_scriptname): Call it. Also, take advantage of missed optimization using func_dirname's additional arguments. (func_mode_compile): Call it. (func_mode_install): Call it. (func_mode_link): Call it.
This commit is contained in:
parent
5a3cf05510
commit
f88b089413
14
ChangeLog
14
ChangeLog
@ -1,10 +1,22 @@
|
||||
2007-07-13 Charles Wilson <libtool@cwilson.fastmail.fm>
|
||||
|
||||
* libltdl/m4/libtool.m4 (func_dirname_and_basename) <XSI>:
|
||||
New function.
|
||||
(func_dirname_and_basename) <!XSI>: New function.
|
||||
* libltdl/config/ltmain.m4sh (func_ltwrapper_scriptname):
|
||||
Call it. Also, take advantage of missed optimization using
|
||||
func_dirname's additional arguments.
|
||||
(func_mode_compile): Call it.
|
||||
(func_mode_install): Call it.
|
||||
(func_mode_link): Call it.
|
||||
|
||||
2007-07-12 Peter Rosin <peda@lysator.liu.se>
|
||||
|
||||
* libltdl/config/ltmain.m4sh (func_mode_link): Strip the cwrapper
|
||||
using $STRIP instead of relying on the tools to support -s, which
|
||||
MSVC doesn't.
|
||||
|
||||
2007-07-06 Peter O'Gorman <peter@pogma.com
|
||||
2007-07-06 Peter O'Gorman <peter@pogma.com>
|
||||
|
||||
* libltdl/config/libtool.m4sh: Don't pass -msg_* through to the
|
||||
linker.
|
||||
|
@ -692,14 +692,9 @@ func_ltwrapper_scriptname ()
|
||||
{
|
||||
func_ltwrapper_scriptname_result=""
|
||||
if func_ltwrapper_executable_p "$1"; then
|
||||
func_dirname "$1"
|
||||
func_basename "$1"
|
||||
func_dirname_and_basename "$1" "" "."
|
||||
func_stripname '' '.exe' "$func_basename_result"
|
||||
if test -z "$func_dirname_result"; then
|
||||
func_ltwrapper_scriptname_result="./$objdir/${func_stripname_result}_ltshwrapper"
|
||||
else
|
||||
func_ltwrapper_scriptname_result="$func_dirname_result/$objdir/${func_stripname_result}_ltshwrapper"
|
||||
fi
|
||||
func_ltwrapper_scriptname_result="$func_dirname_result/$objdir/${func_stripname_result}_ltshwrapper"
|
||||
fi
|
||||
}
|
||||
|
||||
@ -1422,9 +1417,8 @@ func_mode_compile ()
|
||||
test "X$libobj" != "X$func_quote_for_eval_result" \
|
||||
&& $ECHO "X$libobj" | $GREP '[@:>@~#^*{};<>?"'"'"' &()|`$@<:@]' \
|
||||
&& func_warning "libobj name \`$libobj' may not contain shell special characters."
|
||||
func_basename "$obj"
|
||||
func_dirname_and_basename "$obj" "/" ""
|
||||
objname="$func_basename_result"
|
||||
func_dirname "$obj" "/" ""
|
||||
xdir="$func_dirname_result"
|
||||
lobj=${xdir}$objdir/$objname
|
||||
|
||||
@ -1921,9 +1915,8 @@ func_mode_install ()
|
||||
destdir="$dest"
|
||||
destname=
|
||||
else
|
||||
func_dirname "$dest" "" "."
|
||||
func_dirname_and_basename "$dest" "" "."
|
||||
destdir="$func_dirname_result"
|
||||
func_basename "$dest"
|
||||
destname="$func_basename_result"
|
||||
|
||||
# Not a directory, so check to see that there is only one file specified.
|
||||
@ -6785,13 +6778,9 @@ EOF
|
||||
esac
|
||||
case $host in
|
||||
*cygwin* | *mingw* )
|
||||
func_basename "$output"
|
||||
func_dirname_and_basename "$output" "" "."
|
||||
output_name=$func_basename_result
|
||||
func_dirname "$output"
|
||||
output_path=$func_dirname_result
|
||||
if test -z "$output_path"; then
|
||||
output_path=.
|
||||
fi
|
||||
cwrappersource="$output_path/$objdir/lt-$output_name.c"
|
||||
cwrapper="$output_path/$output_name.exe"
|
||||
$RM $cwrappersource $cwrapper
|
||||
|
45
libltdl/m4/libtool.m4
vendored
45
libltdl/m4/libtool.m4
vendored
@ -7056,6 +7056,27 @@ func_basename ()
|
||||
func_basename_result="${1##*/}"
|
||||
}
|
||||
|
||||
# func_dirname_and_basename file append nondir_replacement
|
||||
# perform func_basename and func_dirname in a single function
|
||||
# call:
|
||||
# dirname: Compute the dirname of FILE. If nonempty,
|
||||
# add APPEND to the result, otherwise set result
|
||||
# to NONDIR_REPLACEMENT.
|
||||
# value returned in "$func_dirname_result"
|
||||
# basename: Compute filename of FILE.
|
||||
# value retuned in "$func_basename_result"
|
||||
# Implementation must be kept synchronized with func_dirname
|
||||
# and func_basename. For efficiency, we do not delegate to
|
||||
# those functions but instead duplicate the functionality here.
|
||||
func_dirname_and_basename ()
|
||||
{
|
||||
case ${1} in
|
||||
*/*) func_dirname_result="${1%/*}${2}" ;;
|
||||
* ) func_dirname_result="${3}" ;;
|
||||
esac
|
||||
func_basename_result="${1##*/}"
|
||||
}
|
||||
|
||||
# func_stripname prefix suffix name
|
||||
# strip PREFIX and SUFFIX off of NAME.
|
||||
# PREFIX and SUFFIX must not contain globbing or regex special
|
||||
@ -7109,6 +7130,30 @@ func_basename ()
|
||||
func_basename_result=`$ECHO "X${1}" | $Xsed -e "$basename"`
|
||||
}
|
||||
|
||||
# func_dirname_and_basename file append nondir_replacement
|
||||
# perform func_basename and func_dirname in a single function
|
||||
# call:
|
||||
# dirname: Compute the dirname of FILE. If nonempty,
|
||||
# add APPEND to the result, otherwise set result
|
||||
# to NONDIR_REPLACEMENT.
|
||||
# value returned in "$func_dirname_result"
|
||||
# basename: Compute filename of FILE.
|
||||
# value retuned in "$func_basename_result"
|
||||
# Implementation must be kept synchronized with func_dirname
|
||||
# and func_basename. For efficiency, we do not delegate to
|
||||
# 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"`
|
||||
}
|
||||
|
||||
# func_stripname prefix suffix name
|
||||
# strip PREFIX and SUFFIX off of NAME.
|
||||
# PREFIX and SUFFIX must not contain globbing or regex special
|
||||
|
Loading…
Reference in New Issue
Block a user