2007-02-11 Ralf Wildenhues <Ralf.Wildenhues@gmx.de>
+ * libltdl/m4/libtool.m4 (_LT_PROG_XSI_SHELLFNS): New substituted
+ function `func_lo2o', saving two fork&exec with XSI shells.
+ * libltdl/config/ltmain.m4sh (func_mode_compile)
+ (func_mode_install, func_mode_link): Use it for rewrites of
+ single files.
+
* libltdl/m4/libtool.m4 (_LT_PROG_XSI_SHELLFNS): New function
func_opt_split, for XSI and portable shell.
* libltdl/config/ltmain.m4sh: Move the insertion point for the
libobj=`$ECHO "X$libobj" | $Xsed -e "s/\.$xform$/.lo/"`
case $libobj in
- *.lo) obj=`$ECHO "X$libobj" | $Xsed -e "$lo2o"` ;;
+ *.lo) func_lo2o "$libobj"; obj=$func_lo2o_result ;;
*)
func_fatal_error "cannot determine name of library object from \`$libobj'"
;;
# Deduce the name of the destination old-style object file.
case $destfile in
*.lo)
- staticdest=`$ECHO "X$destfile" | $Xsed -e "$lo2o"`
+ func_lo2o "$destfile"
+ staticdest=$func_lo2o_result
;;
*.$objext)
staticdest="$destfile"
# Install the old object if enabled.
if test "$build_old_libs" = yes; then
# Deduce the name of the old-style object file.
- staticobj=`$ECHO "X$file" | $Xsed -e "$lo2o"`
+ func_lo2o "$file"
+ staticobj=$func_lo2o_result
func_show_eval "$install_prog \$staticobj \$staticdest" 'exit $?'
fi
exit $EXIT_SUCCESS
func_dirname "$arg" "/" ""
xdir="$func_dirname_result"
- pic_object=`$ECHO "X${xdir}${objdir}/${arg}" | $Xsed -e "$lo2o"`
- non_pic_object=`$ECHO "X${xdir}${arg}" | $Xsed -e "$lo2o"`
+ func_lo2o "$arg"
+ pic_object=$xdir$objdir/$func_lo2o_result
+ non_pic_object=$xdir$func_lo2o_result
func_append libobjs " $pic_object"
func_append non_pic_objects " $non_pic_object"
else
func_dirname "$arg" "/" ""
xdir="$func_dirname_result"
- pic_object=`$ECHO "X${xdir}${objdir}/${arg}" | $Xsed -e "$lo2o"`
- non_pic_object=`$ECHO "X${xdir}${arg}" | $Xsed -e "$lo2o"`
+ func_lo2o "$arg"
+ pic_object=$xdir$objdir/$func_lo2o_result
+ non_pic_object=$xdir$func_lo2o_result
func_append libobjs " $pic_object"
func_append non_pic_objects " $non_pic_object"
else
test -n "$objs$old_deplibs" && \
func_fatal_error "cannot build library object \`$output' from non-libtool objects"
- libobj="$output"
- obj=`$ECHO "X$output" | $Xsed -e "$lo2o"`
+ libobj=$output
+ func_lo2o "$libobj"
+ obj=$func_lo2o_result
;;
*)
libobj=
func_opt_split_opt=${1%%=*}
func_opt_split_arg=${1#*=}
}
+
+# func_lo2o object
+func_lo2o ()
+{
+ case ${1} in
+ *.lo) func_lo2o_result=${1%.lo}.${objext} ;;
+ *) func_lo2o_result=${1} ;;
+ esac
+}
_LT_EOF
;;
*) # Bourne compatible functions.
func_opt_split_opt=`$ECHO "X${1}" | $Xsed -e "$my_sed_long_opt"`
func_opt_split_arg=`$ECHO "X${1}" | $Xsed -e "$my_sed_long_arg"`
}
+
+# func_lo2o object
+func_lo2o ()
+{
+ func_lo2o_result=`$ECHO "X${1}" | $Xsed -e "$lo2o"`
+}
_LT_EOF
esac