From: Ralf Wildenhues Date: Sun, 11 Feb 2007 16:22:42 +0000 (+0000) Subject: * libltdl/m4/libtool.m4 (_LT_PROG_XSI_SHELLFNS): New substituted X-Git-Tag: release-2-1b~199 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=0891f8ccc9e80a051942c37835cbf6936e9ddcd4;p=thirdparty%2Flibtool.git * 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. --- diff --git a/ChangeLog b/ChangeLog index 75435b7c9..e10a48fdb 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,5 +1,11 @@ 2007-02-11 Ralf Wildenhues + * 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 diff --git a/libltdl/config/ltmain.m4sh b/libltdl/config/ltmain.m4sh index c6643c66e..783628279 100644 --- a/libltdl/config/ltmain.m4sh +++ b/libltdl/config/ltmain.m4sh @@ -1331,7 +1331,7 @@ func_mode_compile () 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'" ;; @@ -2028,7 +2028,8 @@ func_mode_install () # 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" @@ -2046,7 +2047,8 @@ func_mode_install () # 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 @@ -2491,8 +2493,9 @@ func_mode_link () 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 @@ -3015,8 +3018,9 @@ func_mode_link () 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 @@ -5462,8 +5466,9 @@ EOF 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= diff --git a/libltdl/m4/libtool.m4 b/libltdl/m4/libtool.m4 index a78f343e2..590436c17 100644 --- a/libltdl/m4/libtool.m4 +++ b/libltdl/m4/libtool.m4 @@ -7047,6 +7047,15 @@ func_opt_split () 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. @@ -7097,6 +7106,12 @@ func_opt_split () 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