libtool-patches
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: Extract the archive name from the .la file and use $AR (not ar).


From: Peter Rosin
Subject: Re: Extract the archive name from the .la file and use $AR (not ar).
Date: Tue, 31 Aug 2010 11:49:18 +0200
User-agent: Mozilla/5.0 (Windows; U; Windows NT 5.1; en-US; rv:1.9.2.8) Gecko/20100802 Thunderbird/3.1.2

Den 2010-08-30 20:55 skrev Ralf Wildenhues:
> Hi Peter,
> 
> * Peter Rosin wrote on Mon, Aug 30, 2010 at 03:25:30PM CEST:
>> The archive-in-archive.at test uses ar "blindly". It also assumes that
>> the "old archive" of libfoo.la is named libfoo.a, but both that's not
>> portable. See attached patch.
> 
> OK with nits below.

Thanks!

> I don't like that we don't have a decent abstraction for static
> libraries, but that again is something we *should* fix in Automake
> not Libtool IMVHO.  (I'm not yet quite sure how exactly ...)
> 
> Thanks,
> Ralf
> 
>> --- a/tests/archive-in-archive.at
>> +++ b/tests/archive-in-archive.at
> 
> missing copyright year update.
> 
>> @@ -42,11 +42,15 @@ $LIBTOOL --mode=compile --tag=CC $CC $CPPFLAGS $CFLAGS 
>> -c -o bar.lo bar.c
>>  $LIBTOOL --mode=link --tag=CC --tag=disable-shared $CC $CFLAGS $LDFLAGS \
>>  -o libfoo.la foo.lo -version-info 1:0:0 -rpath $thisdir
>>  $LIBTOOL --mode=install cp libfoo.la $thisdir 
>> +eval `$EGREP '^(old_library)=' < libfoo.la`
>> +libfoo=$old_library
>>  AT_CHECK([$LIBTOOL --mode=link --tag=CC --tag=disable-shared $CC $CFLAGS 
>> $LDFLAGS \
>> -     -o libbar.la bar.lo ./libfoo.a -version-info 1:0:0 -rpath $thisdir],
>> +     -o libbar.la bar.lo $libfoo -version-info 1:0:0 -rpath $thisdir],
>>       [], [ignore], [ignore])
>>  AT_CHECK([$LIBTOOL --mode=install cp libbar.la $thisdir], [], [ignore], 
>> [ignore])
>> -AT_CHECK([ar -t libbar.a | grep libfoo.a],[1],[ignore],[ignore])
>> -archive_contents=`ar -t libbar.a`
>> -AT_XFAIL_IF([case "$archive_contents" in *"libfoo.a"*) : ;; esac])
>> +eval `$EGREP '^(old_library)=' < libbar.la`
>> +libbar=$old_library
>> +AT_CHECK([$AR -t $libbar | grep $libfoo],[1],[ignore],[ignore])
> 
> How about $FGREP?  You' need to extract it from $LIBTOOL though.

Then I can't anchor the fixed pattern at the beginning of the line,
so I'm sticking with EGREP...

>> +archive_contents=`$AR -t $libbar`
>> +AT_XFAIL_IF([case "$archive_contents" in *"$libfoo"*) : ;; esac])
> 
> This AT_XFAIL_IF it completely bogus at this point.  The argument to
> AT_XFAIL_IF is, yes, surprisingly, evaluated *before* the rest of the
> test group is started.  So all it does is
> 
>  AT_XFAIL_IF([case "$empty_var" in *"$another_empty_var"*) : ;; esac])
> 
> Please remove these two lines and instead add
>   AT_XFAIL_IF([:]) dnl This is currently broken
> 
> at the *beginning* of the test group (so readers are not confused)
> right after AT_SETUP, and adjust the log entry accordingly.

Ok, done.

Pushing as attached, expected fail on Cygwin/ar and unexpected pass on
MSYS/lib just as before.

Cheers,
Peter

Attachment: 0001-Extract-the-archive-name-from-the-.la-file-and-use-A.patch.txt
Description: Text document


reply via email to

[Prev in Thread] Current Thread [Next in Thread]