At Mon, 31 Mar 2003 23:10:35 +0900, Naofumi Yasufuku wrote: > > [1 <text/plain; US-ASCII (7bit)>] > At Mon, 31 Mar 2003 05:52:47 +0900, > Naofumi Yasufuku wrote: > > > > Hi, > > > > libtool uses '~' as IFS in some commands (ex. $archive_expsym_cmds), > > so that win32 short name which includes '~' (ex. c:/progra~1/foo/...) > > causes a problem. For example, if we want to build DLL which is linked > > with -Lc:/progra~1/foo/lib -lbar, DLL build command fails. > > > > I think it can be solved by putting off the command list variable > > expansion until its execution loop. > > > > This is the patch against the latest CVS HEAD. > I've tested it under Cygwin/MinGW on my WinXP box. > > Could anyone test this patch? > > Regards, > --Naofumi > > tilde-ifs.patch: [snip]
Former tilde-ifs.patch has a problem with piecewise linking. This is the fixed version of tilde-ifs.patch. I've tested it under MinGW/Cygwin and Linux. Regards, --Naofumi tilde-ifs-2.patch: ------------------------------------------------------------------------------- Index: ltmain.in =================================================================== RCS file: /cvsroot/libtool/libtool/ltmain.in,v retrieving revision 1.333 diff -u -r1.333 ltmain.in --- ltmain.in 31 Mar 2003 17:36:00 -0000 1.333 +++ ltmain.in 1 Apr 2003 07:28:58 -0000 @@ -2279,9 +2279,9 @@ else $show "extracting exported symbol list from \`$soname'" save_ifs="$IFS"; IFS='~' - eval cmds=\"$extract_expsyms_cmds\" - for cmd in $cmds; do + for cmd in $extract_expsyms_cmds; do IFS="$save_ifs" + eval cmd=\"$cmd\" $show "$cmd" $run eval "$cmd" || exit $? done @@ -2292,9 +2292,9 @@ if test -f "$output_objdir/$newlib"; then :; else $show "generating import library for \`$soname'" save_ifs="$IFS"; IFS='~' - eval cmds=\"$old_archive_from_expsyms_cmds\" - for cmd in $cmds; do + for cmd in $old_archive_from_expsyms_cmds; do IFS="$save_ifs" + eval cmd=\"$cmd\" $show "$cmd" $run eval "$cmd" || exit $? done @@ -3541,10 +3541,10 @@ $show "generating symbol list for \`$libname.la'" export_symbols="$output_objdir/$libname.exp" $run $rm $export_symbols - eval cmds=\"$export_symbols_cmds\" save_ifs="$IFS"; IFS='~' - for cmd in $cmds; do + for cmd in $export_symbols_cmds; do IFS="$save_ifs" + eval cmd=\"$cmd\" if len=`expr "X$cmd" : ".*"` && test "$len" -le "$max_cmd_len" || test "$max_cmd_len" -le -1; then $show "$cmd" @@ -3661,19 +3661,20 @@ # Do each of the archive commands. if test "$module" = yes && test -n "$module_cmds" ; then if test -n "$export_symbols" && test -n "$module_expsym_cmds"; then - eval cmds=\"$module_expsym_cmds\" + cmds=$module_expsym_cmds else - eval cmds=\"$module_cmds\" + cmds=$module_cmds fi else - if test -n "$export_symbols" && test -n "$archive_expsym_cmds"; then - eval cmds=\"$archive_expsym_cmds\" - else - eval cmds=\"$archive_cmds\" + if test -n "$export_symbols" && test -n "$archive_expsym_cmds"; then + cmds=$archive_expsym_cmds + else + cmds=$archive_cmds fi fi - if test "X$skipped_export" != "X:" && len=`expr "X$cmds" : ".*"` && + eval test_cmds=\"$cmds\" + if test "X$skipped_export" != "X:" && len=`expr "X$test_cmds" : ".*"` && test "$len" -le "$max_cmd_len" || test "$max_cmd_len" -le -1; then : else @@ -3695,8 +3696,7 @@ # Clear the reloadable object creation command queue and # initialize k to one. - test_cmds= - concat_cmds= + temp_cmds= objlist= delfiles= last_robj= @@ -3705,22 +3705,22 @@ # Loop over the list of objects to be linked. for obj in $save_libobjs do - eval test_cmds=\"$reload_cmds $objlist $last_robj\" + eval temp_cmds=\"$reload_cmds $objlist $last_robj\" if test "X$objlist" = X || - { len=`expr "X$test_cmds" : ".*"` && + { len=`expr "X$temp_cmds" : ".*"` && test "$len" -le "$max_cmd_len"; }; then objlist="$objlist $obj" else - # The command $test_cmds is almost too long, add a - # command to the queue. - if test "$k" -eq 1 ; then - # The first file doesn't have a previous command to add. - eval concat_cmds=\"$reload_cmds $objlist $last_robj\" - else - # All subsequent reloadable object files will link in - # the last one created. - eval concat_cmds=\"\$concat_cmds~$reload_cmds $objlist $last_robj\" - fi + # The command $temp_cmds is almost too long, link piecewise. + temp_cmds="$reload_cmds \$objlist \$last_robj" + save_ifs="$IFS"; IFS='~' + for cmd in $temp_cmds; do + IFS="$save_ifs" + eval cmd=\"$cmd\" + $show "$cmd" + $run eval "$cmd" || exit $? + done + IFS="$save_ifs" last_robj=$output_objdir/$save_output-${k}.$objext k=`expr $k + 1` output=$output_objdir/$save_output-${k}.$objext @@ -3731,16 +3731,30 @@ # Handle the remaining objects by creating one last # reloadable object file. All subsequent reloadable object # files will link in the last one created. - test -z "$concat_cmds" || concat_cmds=$concat_cmds~ - eval concat_cmds=\"\${concat_cmds}$reload_cmds $objlist $last_robj\" + temp_cmds="$reload_cmds \$objlist \$last_robj" + save_ifs="$IFS"; IFS='~' + for cmd in $temp_cmds; do + IFS="$save_ifs" + eval cmd=\"$cmd\" + $show "$cmd" + $run eval "$cmd" || exit $? + done + IFS="$save_ifs" if ${skipped_export-false}; then $show "generating symbol list for \`$libname.la'" export_symbols="$output_objdir/$libname.exp" $run $rm $export_symbols libobjs=$output - # Append the command to create the export file. - eval concat_cmds=\"\$concat_cmds~$export_symbols_cmds\" + # Execute the command to create the export file. + save_ifs="$IFS"; IFS='~' + for cmd in $export_symbols_cmds; do + IFS="$save_ifs" + eval cmd=\"$cmd\" + $show "$cmd" + $run eval "$cmd" || exit $? + done + IFS="$save_ifs" fi # Set up a command to remove the reloadale object files @@ -3752,17 +3766,6 @@ delfiles="$delfiles $output_objdir/$save_output-${i}.$objext" done - $echo "creating a temporary reloadable object file: $output" - - # Loop through the commands generated above and execute them. - save_ifs="$IFS"; IFS='~' - for cmd in $concat_cmds; do - IFS="$save_ifs" - $show "$cmd" - $run eval "$cmd" || exit $? - done - IFS="$save_ifs" - libobjs=$output # Restore the value of output. output=$save_output @@ -3770,23 +3773,15 @@ if test -n "$convenience" && test -n "$whole_archive_flag_spec"; then eval libobjs=\"\$libobjs $whole_archive_flag_spec\" fi - # Expand the library linking commands again to reset the - # value of $libobjs for piecewise linking. - - # Do each of the archive commands. - if test -n "$export_symbols" && test -n "$archive_expsym_cmds"; then - eval cmds=\"$archive_expsym_cmds\" - else - eval cmds=\"$archive_cmds\" - fi # Append the command to remove the reloadable object files # to the just-reset $cmds. - eval cmds=\"\$cmds~$rm $delfiles\" + cmds="$cmds~\$rm \$delfiles" fi save_ifs="$IFS"; IFS='~' for cmd in $cmds; do IFS="$save_ifs" + eval cmd=\"$cmd\" $show "$cmd" $run eval "$cmd" || exit $? done @@ -3937,10 +3932,10 @@ reload_objs="$objs$old_deplibs "`$echo "X$libobjs" | $SP2NL | $Xsed -e '/\.'${libext}$'/d' -e '/\.lib$/d' -e "$lo2o" | $NL2SP`" $reload_conv_objs" ### testsuite: skip nested quoting test output="$obj" - eval cmds=\"$reload_cmds\" save_ifs="$IFS"; IFS='~' - for cmd in $cmds; do + for cmd in $reload_cmds; do IFS="$save_ifs" + eval cmd=\"$cmd\" $show "$cmd" $run eval "$cmd" || exit $? done @@ -3973,10 +3968,10 @@ # Only do commands if we really have different PIC objects. reload_objs="$libobjs $reload_conv_objs" output="$libobj" - eval cmds=\"$reload_cmds\" save_ifs="$IFS"; IFS='~' - for cmd in $cmds; do + for cmd in $reload_cmds; do IFS="$save_ifs" + eval cmd=\"$cmd\" $show "$cmd" $run eval "$cmd" || exit $? done @@ -4948,11 +4943,12 @@ # Do each command in the archive commands. if test -n "$old_archive_from_new_cmds" && test "$build_libtool_libs" = yes; then - eval cmds=\"$old_archive_from_new_cmds\" + cmds=$old_archive_from_new_cmds else - eval cmds=\"$old_archive_cmds\" + cmds=$old_archive_cmds - if len=`expr "X$cmds" : ".*"` && + eval test_cmds=\"$cmds\" + if len=`expr "X$test_cmds" : ".*"` && test "$len" -le "$max_cmd_len" || test "$max_cmd_len" -le -1; then : else @@ -4961,7 +4957,6 @@ save_RANLIB=$RANLIB RANLIB=: objlist= - concat_cmds= save_oldobjs=$oldobjs # GNU ar 2.10+ was changed to match POSIX; thus no paths are # encoded into archives. This makes 'ar r' malfunction in @@ -4996,23 +4991,29 @@ if test "$obj" = "$last_oldobj" ; then RANLIB=$save_RANLIB fi - test -z "$concat_cmds" || concat_cmds=$concat_cmds~ - eval concat_cmds=\"\${concat_cmds}$old_archive_cmds\" + # a piece archive + save_ifs="$IFS"; IFS='~' + for cmd in $old_archive_cmds; do + IFS="$save_ifs" + eval cmd=\"$cmd\" + $show "$cmd" + $run eval "$cmd" || exit $? + done + IFS="$save_ifs" objlist= fi done RANLIB=$save_RANLIB oldobjs=$objlist if test "X$oldobjs" = "X" ; then - eval cmds=\"\$concat_cmds\" - else - eval cmds=\"\$concat_cmds~$old_archive_cmds\" + cmds="" fi fi fi save_ifs="$IFS"; IFS='~' for cmd in $cmds; do IFS="$save_ifs" + eval cmd=\"$cmd\" $show "$cmd" $run eval "$cmd" || exit $? done @@ -5408,10 +5409,10 @@ # Do each command in the postinstall commands. lib="$destdir/$realname" - eval cmds=\"$postinstall_cmds\" save_ifs="$IFS"; IFS='~' - for cmd in $cmds; do + for cmd in $postinstall_cmds; do IFS="$save_ifs" + eval cmd=\"$cmd\" $show "$cmd" $run eval "$cmd" || exit $? done @@ -5630,10 +5631,10 @@ fi # Do each command in the postinstall commands. - eval cmds=\"$old_postinstall_cmds\" save_ifs="$IFS"; IFS='~' - for cmd in $cmds; do + for cmd in $old_postinstall_cmds; do IFS="$save_ifs" + eval cmd=\"$cmd\" $show "$cmd" $run eval "$cmd" || exit $? done @@ -5668,10 +5669,10 @@ for libdir in $libdirs; do if test -n "$finish_cmds"; then # Do each command in the finish commands. - eval cmds=\"$finish_cmds\" save_ifs="$IFS"; IFS='~' - for cmd in $cmds; do + for cmd in $finish_cmds; do IFS="$save_ifs" + eval cmd=\"$cmd\" $show "$cmd" $run eval "$cmd" || admincmds="$admincmds $cmd" @@ -5945,10 +5946,10 @@ if test "$mode" = uninstall; then if test -n "$library_names"; then # Do each command in the postuninstall commands. - eval cmds=\"$postuninstall_cmds\" save_ifs="$IFS"; IFS='~' - for cmd in $cmds; do + for cmd in $postuninstall_cmds; do IFS="$save_ifs" + eval cmd=\"$cmd\" $show "$cmd" $run eval "$cmd" if test "$?" -ne 0 && test "$rmforce" != yes; then @@ -5960,10 +5961,10 @@ if test -n "$old_library"; then # Do each command in the old_postuninstall commands. - eval cmds=\"$old_postuninstall_cmds\" save_ifs="$IFS"; IFS='~' - for cmd in $cmds; do + for cmd in $old_postuninstall_cmds; do IFS="$save_ifs" + eval cmd=\"$cmd\" $show "$cmd" $run eval "$cmd" if test "$?" -ne 0 && test "$rmforce" != yes; then -------------------------------------------------------------------------------
tilde-ifs-2.patch.gz
Description: Binary data
_______________________________________________ Libtool mailing list [EMAIL PROTECTED] http://mail.gnu.org/mailman/listinfo/libtool