[Top][All Lists]
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Command file interface to archiver (was: Re: msvs support)
From: |
Peter Ekberg |
Subject: |
Command file interface to archiver (was: Re: msvs support) |
Date: |
Tue, 14 Feb 2006 11:19:25 +0100 |
User-agent: |
Mutt/1.5.11 |
Hi Ralf!
> | @@ -6342,44 +6454,59 @@
> | test "$len" -le "$max_cmd_len" || test "$max_cmd_len" -le -1; then
> | cmds=$old_archive_cmds
> | else
> | - # the command line is too long to link in one step, link in parts
> | - func_echo "using piecewise archive linking..."
> | - save_RANLIB=$RANLIB
> | - RANLIB=:
> | - objlist=
> | - concat_cmds=
> | - save_oldobjs=$oldobjs
> | - # Is there a better way of finding the last object in the list?
> | - for obj in $save_oldobjs
> | - do
> | - last_oldobj=$obj
> | - done
> | - for obj in $save_oldobjs
> | - do
> | - oldobjs="$objlist $obj"
> | - objlist="$objlist $obj"
> | - eval test_cmds=\"$old_archive_cmds\"
> | - if len=`expr "X$test_cmds" : ".*" 2>/dev/null` &&
> | - test "$len" -le "$max_cmd_len"; then
> | - :
> | - else
> | - # the above command should be used before it gets too long
> | - oldobjs=$objlist
> | - if test "$obj" = "$last_oldobj" ; then
> | - RANLIB=$save_RANLIB
> | + case $host_os/$with_gcc in
> | + mingw*/no | mingw*/ | cygwin*/no | cygwin*/)
> | + # Assume MSVC _and_ lib archiver interface...
> | + func_echo "using command file archive linking..."
> | + for obj in $oldobjs; do
> | + $ECHO \""$obj"\"
> | + done > $output_objdir/$libname.libcmd
> | + save_oldobjs="$oldobjs"
> | + oldobjs=" @$output_objdir/$libname.libcmd"
> | + eval cmds=\"\$old_archive_cmds\"
> | + oldobjs="$save_oldobjs"
> | + ;;
> | + *)
> | + # the command line is too long to link in one step, link in parts
> | + func_echo "using piecewise archive linking..."
> | + save_RANLIB=$RANLIB
> | + RANLIB=:
> | + objlist=
> | + concat_cmds=
> | + save_oldobjs=$oldobjs
> | + # Is there a better way of finding the last object in the list?
> | + for obj in $save_oldobjs
> | + do
> | + last_oldobj=$obj
> | + done
> | + for obj in $save_oldobjs
> | + do
> | + oldobjs="$objlist $obj"
> | + objlist="$objlist $obj"
> | + eval test_cmds=\"$old_archive_cmds\"
> | + if len=`expr "X$test_cmds" : ".*" 2>/dev/null` &&
> | + test "$len" -le "$max_cmd_len"; then
> | + :
> | + else
> | + # the above command should be used before it gets too long
> | + oldobjs=$objlist
> | + 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\"
> | + objlist=
> | fi
> | - test -z "$concat_cmds" || concat_cmds=$concat_cmds~
> | - eval concat_cmds=\"\${concat_cmds}$old_archive_cmds\"
> | - objlist=
> | + done
> | + RANLIB=$save_RANLIB
> | + oldobjs=$objlist
> | + if test "X$oldobjs" = "X" ; then
> | + eval cmds=\"\$concat_cmds\"
> | + else
> | + eval cmds=\"\$concat_cmds~\$old_archive_cmds\"
> | 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\"
> | - fi
> | + ;;
> | + esac
> | fi
> | fi
> | func_execute_cmds "$cmds" 'exit $?'
>
> I don't like this big hunk yet. It's pretty invasive, it assumes
> | + # Assume MSVC _and_ lib archiver interface...
>
> and there is room for other systems to improve, too.
> Side note:
> | + if test "X$oldobjs" = "X" ; then
>
> could be `test -z "$oldobjs"'.
Huh? What is invasive about it? Yes, the hunk is large, but the bulk
of it is just an indentation change. The meat is 8 lines of code
specific for MSVC.
Agreed, the test should be done in libtool.m4 and be propagated to
ltmain through some variable, and other systems could perhaps
benefit from a command file to the archiver as well. You did not
like the other command file interface, can you please specify this
one to your liking? Please ;-)
I have found no way to do piecewise linking using Microsoft link,
so AFAIK the command file is desperately needed here, and I did
not find a better way to add it, sorry.
Comment to side note: that is just reindented old code, so don't
blame me :-)
Cheers,
Peter